robot_2Generated
code_blocksInput

Description

The Tags field in the SceneTraceResult struct represents an array of strings that contain the tags associated with the shape that was hit during a scene trace operation. Tags are typically used to categorize or identify objects within a scene, allowing for more detailed interaction and filtering based on these identifiers.

Usage

Use the Tags field to retrieve the tags of the shape that was hit in a trace operation. This can be useful for determining the type or category of the object that was hit, which can influence game logic or visual effects.

Example

// Example of accessing the Tags field from a SceneTraceResult
SceneTraceResult traceResult = SceneTraceResult.From(scene, trace);

if (traceResult.Hit)
{
    string[] hitTags = traceResult.Tags;
    foreach (string tag in hitTags)
    {
        // Process each tag
        if (tag == "Enemy")
        {
            // Handle enemy hit
        }
    }
}