Description
The Point
field in the PhysicsContact
struct represents the exact location in world space where a collision or contact occurs between two physical objects. This field is of type Vector3
, which means it contains three-dimensional coordinates (x, y, z) that specify the position of the contact point.
Usage
Use the Point
field to determine the precise location of a collision in your physics simulations or game logic. This can be useful for applying effects at the point of contact, such as spawning particles, playing sound effects, or calculating damage based on the impact location.
Example
// Example of accessing the Point field in a PhysicsContact
// Assume 'contact' is an instance of PhysicsContact
Vector3 contactPoint = contact.Point;
// Use the contact point for further processing
Debug.Log($"Collision occurred at: {contactPoint}");
// Example of using the contact point to spawn an effect
Effect.Spawn("particles/impact", contactPoint);