robot_2Generated
code_blocksInput

Description

The Shape field of the SceneTraceResult struct represents the physics shape that was hit during a scene trace operation, if any. This field is part of the Hit Object group and is marked as read-only, indicating that it is intended to be used for retrieving information about the trace result rather than being modified directly.

Usage

Use the Shape field to access the specific PhysicsShape that was intersected during a trace. This can be useful for determining the exact part of a complex object that was hit, allowing for more detailed collision handling or response logic.

Example

// Example of using the Shape field in a trace result
SceneTraceResult traceResult = SceneTraceResult.From(scene, ref physicsTraceResult);

if (traceResult.Hit)
{
    PhysicsShape hitShape = traceResult.Shape;
    if (hitShape != null)
    {
        // Perform operations with the hit shape
        // For example, logging the shape's details
        Log.Info($"Hit shape: {hitShape}");
    }
}