Description
The Self
property of the PhysicsIntersection
struct represents one of the two entities involved in a physics contact. It is of type PhysicsContact.Target
, which typically refers to a game object or component that is part of the physics simulation.
Usage
Use the Self
property to access or modify the target entity that is considered as "self" in the context of a physics intersection. This property is useful when you need to determine which object in a collision is the one being referenced as the primary or initiating object.
Example
// Example of accessing the Self property in a PhysicsIntersection
PhysicsIntersection intersection = GetPhysicsIntersection();
PhysicsContact.Target selfTarget = intersection.Self;
// Use selfTarget to perform operations specific to the 'self' entity
if (selfTarget.IsValid)
{
// Perform operations with selfTarget
}