Vector3 EndPosition

robot_2Generated
code_blocksInput

Description

The EndPosition field represents the final position of a trace operation in a scene. It is a Vector3 value that indicates where the trace ended or where it hit an object within the scene. This field is part of the SceneTraceResult structure, which provides detailed information about the result of a trace operation.

Usage

Use the EndPosition field to determine the exact location where a trace operation concluded. This can be useful for understanding the path of a trace and for determining interactions with objects in the scene. Since this field is read-only, it is typically accessed after performing a trace to analyze the result.

Example

// Example of using SceneTraceResult to get the end position of a trace
SceneTraceResult traceResult = SceneTraceResult.From(scene, trace);
Vector3 endPosition = traceResult.EndPosition;

// Use endPosition for further logic, such as placing an object or determining hit effects
if (traceResult.Hit)
{
    // Perform actions based on the hit
    Debug.Log($"Trace ended at position: {endPosition}");
}