class in UnityEngine
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.Close
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.Close
A base class of all colliders.
See Also: BoxCollider, SphereCollider, CapsuleCollider, MeshCollider, PhysicMaterial, Rigidbody.
If the object with the Collider needs to be moved during gameplay then you should also attach a Rigidbody component to the object. The Rigidbody can be set to be kinematic if you don't want the object to have physical interaction with other objects.
|The rigidbody the collider is attached to.
|The world space bounding volume of the collider (Read Only).
|Contact offset value of this collider.
|Enabled Colliders will collide with other Colliders, disabled Colliders won't.
|Is the collider a trigger?
|The material used by the collider.
|The shared physic material of this collider.
|Returns a point on the collider that is closest to a given location.
|The closest point to the bounding box of the attached collider.
|Casts a Ray that ignores all Colliders except this one.
|OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider.
|OnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider.
|OnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider.
|OnTriggerEnter is called when the Collider other enters the trigger.
|OnTriggerExit is called when the Collider other has stopped touching the trigger.
|OnTriggerStay is called almost all the frames for every Collider other that is touching the trigger. The function is on the physics timer so it won't necessarily run every frame.
|The game object this component is attached to. A component is always attached to a game object.
|The tag of this game object.
|The Transform attached to this GameObject.
|Should the object be hidden, saved with the Scene or modifiable by the user?
|The name of the object.
|Calls the method named methodName on every MonoBehaviour in this game object or any of its children.
|Is this game object tagged with tag ?
|Returns the component of Type type if the game object has one attached, null if it doesn't.
|Returns the component of Type type in the GameObject or any of its children using depth first search.
|Returns the component of Type type in the GameObject or any of its parents.
|Returns all components of Type type in the GameObject.
|Returns all components of Type type in the GameObject or any of its children.
|Returns all components of Type type in the GameObject or any of its parents.
|Calls the method named methodName on every MonoBehaviour in this game object.
|Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.
|Returns the instance id of the object.
|Returns the name of the GameObject.
|Removes a gameobject, component or asset.
|Destroys the object obj immediately. You are strongly recommended to use Destroy instead.
|Do not destroy the target Object when loading a new Scene.
|Returns the first active loaded object of Type type.
|Returns a list of all active loaded objects of Type type.
|Clones the object original and returns the clone.