Version: 2017.1

Collision2D

class in UnityEngine

Switch to Manual

Description

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.
contactsКонкретные точки соприкосновения с входящим Collider2D.
enabledIndicates whether the collision response or reaction is enabled or disabled.
gameObjectВходящий GameObject участвующий в коллизии.
otherColliderThe other Collider2D involved in the collision with the collider.
otherRigidbodyThe other Rigidbody2D involved in the collision with the rigidbody.
relativeVelocityОтносительная линейная скорость двух столкнувшихся объектов (Read Only).
rigidbodyThe incoming Rigidbody2D involved in the collision with the otherRigidbody.
transformTransform входящего объекта, участвующего в коллизии.