Skip to main content

Collision

Describes a collision. Unity Collision

Members

Properties

NameDescription
Collision.colliderThe Collider we hit (Read Only).
Collision.contactCountGets the number of contacts for this collision.
Collision.contactsThe contact points generated by the physics engine. You should avoid using this as it produces memory garbage. Use GetContact or GetContacts instead.
Collision.gameObjectThe GameObject whose collider you are colliding with. (Read Only).
Collision.impulseThe total impulse applied to this contact pair to resolve the collision.
Collision.relativeVelocityThe relative linear velocity of the two colliding objects (Read Only).
Collision.rigidbodyThe Rigidbody we hit (Read Only). This is nil if the object we hit is a collider with no rigidbody attached.
Collision.transformThe Transform of the object we hit (Read Only).

Methods

NameDescription
Collision.GetContact(index)Gets the contact point at the specified index.