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

