Version: 2017.2

Collision2D

class in UnityEngine

Cambiar al Manual

Descripción

Collision details returned by 2D physics callback functions.

The collisions details are returned by MonoBehaviour.OnCollisionEnter2D, MonoBehaviour.OnCollisionStay2D and MonoBehaviour.OnCollisionExit2D callbacks. It details which Collider2D and Rigidbody2D pairs are involved in the collision as well as contact points where the Collider2D meet.

Variables

colliderThe incoming Collider2D involved in the collision with the otherCollider.
contactsThe specific points of contact with the incoming Collider2D. You should avoid using this as it produces memory garbage. Use GetContacts instead.
enabledIndicates whether the collision response or reaction is enabled or disabled.
gameObjectEl GameObject entrante involucrado en la colisión.
otherColliderThe other Collider2D involved in the collision with the collider.
otherRigidbodyThe other Rigidbody2D involved in the collision with the rigidbody.
relativeVelocityLa velocidad lineal relativa de los dos objetos que colisionan (Read Only).
rigidbodyThe incoming Rigidbody2D involved in the collision with the otherRigidbody.
transformEl Transform del objeto entrante involucrado en la colisión.

Funciones Públicas

GetContactsRetrieves all contact points in for contacts between collider and otherCollider.