API > Collider
Collider⚓︎
Collider inherits from Component
A base class of all colliders. Unity Collider
Members⚓︎
Properties⚓︎
Name | Description |
---|---|
Collider .attachedRigidbody |
The rigidbody the collider is attached to. |
Collider .bounds |
The world space bounding volume of the collider (Read Only). |
Collider .contactOffset |
Contact offset value of this collider. |
Collider .enabled |
Enabled Colliders will collide with other Colliders, disabled Colliders won't. |
Collider .isTrigger |
Is the collider a trigger? |
Collider .material |
The material used by the collider. |
Collider .sharedMaterial |
The shared physic material of this collider. |
Methods⚓︎
Name | Description |
---|---|
Collider .ClosestPoint(position) |
Returns a point on the collider that is closest to a given location. |
Collider .ClosestPointOnBounds(position) |
The closest point to the bounding box of the attached collider. |
Collider .Raycast(ray, maxDistance) |
Casts a Ray that ignores all Colliders except this one. |
Inherited Members⚓︎
Inherited Properties⚓︎
Name | Description |
---|---|
Collider .gameObject |
The game object this component is attached to. A component is always attached to a game object. |
Collider .tag |
The tag of this game object. |
Collider .transform |
The Transform attached to this GameObject. |
Collider .hideFlags |
Should the object be hidden, saved with the Scene or modifiable by the user? |
Collider .name |
The name of the object. |
Inherited Methods⚓︎
Name | Description |
---|---|
Collider .BroadcastMessage(methodName, parameter=nil) |
Calls the method named methodName on every Lua Script in this game object or any of its children. |
Collider .CompareTag(tag) |
Is this game object tagged with tag ? |
Collider .GetAllLuaScripts() |
Returns an array of all Lua scripts that attached to the game object. |
Collider .GetComponent(type) |
Returns the component of Type type if the game object has one attached, nil if it doesn't. |
Collider .GetComponentInChildren(t) |
Returns the component of Type type in the GameObject or any of its children using depth first search. |
Collider .GetComponentInParent(t) |
Returns the component of Type type in the GameObject or any of its parents. |
Collider .GetComponents(type) |
Returns all components of Type type in the GameObject. |
Collider .GetComponentsInChildren(t) |
Returns all components of Type type in the GameObject or any of its children. |
Collider .GetComponentsInParent(t) |
Returns all components of Type type in the GameObject or any of its parents. |
Collider .SendMessage(methodName, value=nil) |
Calls the method named methodName on every Lua Script in this game object. |
Collider .SendMessageUpwards(methodName, value=nil) |
Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour. |
Collider .TryGetComponent(type) |
Gets the component of the specified type, if it exists. |
Collider .GetInstanceID() |
Returns the instance id of the object. |