Collision
Collision encapsulates details about interactions between moving objects, including the collision's impact, the objects involved, and the exact collision points. It offers a suite of properties that provide insights into the physical dynamics of a collision, aiding in the application of game logic and physics manipulations during collision events. The Collision class is pivotal for handling "OnCollision" events, offering a detailed framework for understanding and reacting to in-game physical interactions. Refer to Unity's official Collision documentation for a deeper exploration. Unity's Collision Documentation
Properties
Similar to 'rigidbody', it references the body involved in the collision for adjustments or analysis. Unity's Collision.body Documentation
Points to the Collider component of the object hit, crucial for accessing collision properties. Unity's Collision.collider Documentation
Reveals the number of contact points in the collision, informative for collision scope assessment. Unity's Collision.contactCount Documentation
Grants access to the GameObject that was part of the collision, enabling game logic application. Unity's Collision.gameObject Documentation
Indicates the total impulse applied to simulate the collision, useful for measuring collision impact. Unity's Collision.impulse Documentation
Provides the speed difference at the moment of collision, aiding in speed-based logic. Unity's Collision.relativeVelocity Documentation
References the Rigidbody of the collided object, enabling direct manipulation post-collision. Unity's Collision.rigidbody Documentation
Accesses the Transform of the collided object, offering positional and rotational control. Unity's Collision.transform Documentation
Methods
Parameters
index
Returns
Updated 4 days ago