robot_2Generated
code_blocksInput

Description

The Body field of the SceneTraceResult struct represents the physics object that was hit during a trace operation, if any. This field is read-only and provides access to the PhysicsBody instance that was involved in the collision.

Usage

Use the Body field to access the physics object that was hit during a trace. This can be useful for determining the physical properties or state of the object involved in the collision.

Example

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

if (traceResult.Hit)
{
    PhysicsBody hitBody = traceResult.Body;
    if (hitBody != null)
    {
        // Perform operations with the hitBody
        // For example, apply a force or check its velocity
    }
}