Collider
Defines the collision shape of a GameObject for physics and trigger detection. In VRChat worlds, colliders are essential for player interaction zones, trigger volumes, and physical boundaries.
Properties
| Property | Type | Access |
|---|---|---|
| attachedArticulationBody | UnityEngineArticulationBody | get |
| attachedRigidbody | Rigidbody | get |
| bounds | UnityEngineBounds | get |
| contactOffset | float | get, set |
| enabled | bool | get, set |
| excludeLayers | UnityEngineLayerMask | get, set |
| gameObject | GameObject | get |
| hasModifiableContacts | bool | get, set |
| includeLayers | UnityEngineLayerMask | get, set |
| isTrigger | bool | get, set |
| layerOverridePriority | int | get, set |
| material | UnityEnginePhysicMaterial | get, set |
| name | string | get, set |
| providesContacts | bool | get, set |
| sharedMaterial | UnityEnginePhysicMaterial | get, set |
| transform | Transform | get |
attachedRigidbody
The Rigidbody attached to this collider’s GameObject, or null if none.
let rb: Rigidbody = collider.attachedRigidbodybounds
The world-space bounding box of the collider.
let b: Bounds = collider.boundsenabled
Whether this collider is active. Disabled colliders are ignored by physics.
collider.enabled = falseisTrigger
When true, the collider acts as a trigger zone instead of a solid surface.
collider.isTrigger = trueMethods
ClosestPoint
ClosestPoint(position: Vector3) -> Vector3Returns the closest point on the collider surface to a given position.
let closest: Vector3 = collider.ClosestPoint(playerPos)ClosestPointOnBounds
ClosestPointOnBounds(position: Vector3) -> Vector3Equals
Equals(other: object) -> boolGetComponent
GetComponent(type: string) -> UnityEngineComponentGetComponent(type: SystemType) -> UnityEngineComponentGetComponent(type: SystemType) -> UnityEngineObjectGetComponentInChildren
GetComponentInChildren(includeInactive: bool, type: SystemType) -> UnityEngineObjectGetComponentInChildren(t: SystemType, includeInactive: bool) -> UnityEngineComponentGetComponentInChildren(t: SystemType) -> UnityEngineComponentGetComponentInChildren(type: SystemType) -> UnityEngineObjectGetComponentInParent
GetComponentInParent(includeInactive: bool, type: SystemType) -> UnityEngineObjectGetComponentInParent(t: SystemType, includeInactive: bool) -> UnityEngineComponentGetComponentInParent(t: SystemType) -> UnityEngineComponentGetComponentInParent(type: SystemType) -> UnityEngineObjectGetComponents
GetComponents(results: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]], type: SystemType) -> voidGetComponents(type: SystemType, results: SystemCollectionsGenericList`1[[UnityEngineComponent, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> voidGetComponents(type: SystemType) -> UnityEngineComponent[]GetComponents(type: SystemType) -> UnityEngineObject[]GetComponentsInChildren
GetComponentsInChildren(results: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]], type: SystemType) -> voidGetComponentsInChildren(includeInactive: bool, result: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> voidGetComponentsInChildren(includeInactive: bool, type: SystemType) -> UnityEngineObject[]GetComponentsInChildren(t: SystemType, includeInactive: bool) -> UnityEngineComponent[]GetComponentsInChildren(t: SystemType) -> UnityEngineComponent[]GetComponentsInChildren(type: SystemType) -> UnityEngineObject[]GetComponentsInParent
GetComponentsInParent(includeInactive: bool, results: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> voidGetComponentsInParent(includeInactive: bool, type: SystemType) -> UnityEngineObject[]GetComponentsInParent(t: SystemType, includeInactive: bool) -> UnityEngineComponent[]GetComponentsInParent(t: SystemType) -> UnityEngineComponent[]GetComponentsInParent(type: SystemType) -> UnityEngineObject[]GetHashCode
GetHashCode() -> intGetInstanceID
GetInstanceID() -> intGetType
GetType() -> SystemTypeRaycast
Raycast(ray: UnityEngineRay, hitInfo: UnityEngineRaycastHit, maxDistance: float) -> boolCasts a ray against this collider and returns hit information.
// Use Physics.Raycast for general raycasting insteadToString
ToString() -> string