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.
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.
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 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 }