Skip to main content

Collider

info

Collider inherits from Component

A base class of all colliders. Unity Collider

Members

Properties

NameDescription
Collider.attachedRigidbodyThe rigidbody the collider is attached to.
Collider.boundsThe world space bounding volume of the collider (Read Only).
Collider.contactOffsetContact offset value of this collider.
Collider.enabledEnabled Colliders will collide with other Colliders, disabled Colliders won't.
Collider.isTriggerIs the collider a trigger?
Collider.materialThe material used by the collider.
Collider.sharedMaterialThe shared physic material of this collider.

Methods

NameDescription
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

NameDescription
Collider.gameObjectThe game object this component is attached to. A component is always attached to a game object.
Collider.tagThe tag of this game object.
Collider.transformThe Transform attached to this GameObject.
Collider.hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
Collider.nameThe name of the object.

Inherited Methods

NameDescription
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.