Vector3 EndPosition

book_4_sparkGenerated
code_blocksInput

Description

The EndPosition field of the PhysicsTraceResult struct represents the final position of a physics trace. This position is where the trace ends, which could be the point of impact if the trace hits an object, or the end of the trace path if no collision occurs.

Usage

Use the EndPosition field to determine the final location of a trace operation. This can be useful for understanding where a trace concluded, whether it hit an object or not. It is a Vector3 type, providing the x, y, and z coordinates of the end position.

Example

// Example of using EndPosition in a trace operation
PhysicsTraceResult traceResult = PerformTrace();

if (traceResult.Hit)
{
    Vector3 hitLocation = traceResult.EndPosition;
    // Use hitLocation for further processing, such as spawning effects
}
else
{
    Vector3 endLocation = traceResult.EndPosition;
    // Use endLocation to determine where the trace ended without hitting
}