bool Hit

robot_2Generated
code_blocksInput

Description

The Hit field of the PhysicsTraceResult struct indicates whether the trace operation resulted in a collision with any object. It is a boolean value that is set to true if the trace hit something, and false otherwise.

Usage

Use the Hit field to determine if a physics trace operation has successfully collided with an object. This can be useful for implementing collision detection logic in your game or simulation.

Example

// Example usage of PhysicsTraceResult.Hit
PhysicsTraceResult traceResult = PerformPhysicsTrace();

if (traceResult.Hit)
{
    // Handle collision
    Vector3 hitPosition = traceResult.HitPosition;
    // Additional logic for when a hit occurs
}
else
{
    // Logic for when no collision occurs
}