Hitbox Hitbox

robot_2Generated
code_blocksInput

Description

The Hitbox field in the SceneTraceResult struct represents the specific hitbox that was intersected during a scene trace operation. This field is read-only and provides detailed information about the hitbox involved in the collision.

Usage

Use the Hitbox field to access the hitbox that was hit during a trace operation. This can be useful for determining the exact part of an object that was intersected, which can be critical for gameplay mechanics such as damage calculation or hit detection.

Example

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

if (traceResult.Hit)
{
    Hitbox hitbox = traceResult.Hitbox;
    // Perform operations with the hitbox
    // For example, log the hitbox information
    Log.Info($"Hitbox ID: {hitbox.Id}");
}