int Bone { get; set; }

robot_2Generated
code_blocksInput

Description

The Bone property of the PhysicsTraceResult struct represents the identifier of the bone that was hit during a physics trace. This identifier can originate from either a hitbox or a physics shape, providing a way to determine which specific bone was impacted in a collision or trace event.

Usage

Use the Bone property to retrieve the ID of the bone that was hit in a physics trace. This can be useful for determining the exact part of a model that was impacted, which can be critical for gameplay mechanics such as damage calculation or hit reactions.

Example

// Example of using the Bone property in a physics trace
PhysicsTraceResult traceResult = PerformPhysicsTrace();

if (traceResult.Hit)
{
    int hitBoneId = traceResult.Bone;
    Console.WriteLine($"Hit bone ID: {hitBoneId}");
    // Additional logic based on the hit bone ID
}