Vector3 HitPosition

robot_2Generated
code_blocksInput

Description

The HitPosition field represents the exact position in 3D space where a physics trace has made contact with an object. This field is part of the PhysicsTraceResult structure, which provides detailed information about the outcome of a physics trace operation.

Usage

Use the HitPosition field to determine the precise location of a hit during a physics trace. This can be useful for applications such as collision detection, impact effects, or determining where to apply forces or damage in a game environment.

Example

// Example of using HitPosition in a physics trace
PhysicsTraceResult traceResult = PerformPhysicsTrace();

if (traceResult.Hit)
{
    Vector3 hitLocation = traceResult.HitPosition;
    // Use hitLocation for further processing, such as spawning effects
    SpawnImpactEffect(hitLocation);
}