Component Component

robot_2Generated
code_blocksInput

Description

The Component field in the SceneTraceResult struct represents the specific Component that was hit during a scene trace operation. This field is read-only and provides information about the component that was intersected by the trace.

Usage

Use the Component field to access the component that was hit in a trace operation. This can be useful for determining which part of a game object was intersected, allowing for more detailed interaction logic based on the specific component hit.

Example

// Example of using SceneTraceResult to get the hit component
SceneTraceResult traceResult = Scene.Trace(...);

if (traceResult.Hit)
{
    Component hitComponent = traceResult.Component;
    // Perform operations with the hit component
    // For example, logging the component's name
    Log.Info($"Hit component: {hitComponent.Name}");
}