Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Collision2D

Namespace: UnityEngine

Description

Information returned by a collision in 2D physics.

Variables

colliderThe incoming Collider2D involved in the collision.
contactsThe specific points of contact with the incoming Collider2D.
gameObjectThe incoming GameObject involved in the collision.
relativeVelocityThe relative linear velocity of the two colliding objects (Read Only).
rigidbodyThe incoming Rigidbody2D involved in the collision.
transformThe Transform of the incoming object involved in the collision.