robot_2Generated
code_blocksInput

Description

The Tags field in the PhysicsTraceResult struct represents an array of strings that contain the tags associated with the shape that was hit during a physics trace. Tags are typically used to categorize or identify specific characteristics or properties of the shape, allowing for more detailed interaction or filtering logic in your game.

Usage

Use the Tags field to access or evaluate the tags of the shape that was hit in a physics trace. This can be useful for determining specific actions or responses based on the type of object that was hit. For example, you might want to apply different logic if the hit object is tagged as "Enemy" versus "Obstacle".

Example

// Example of using the Tags field in a PhysicsTraceResult
PhysicsTraceResult traceResult = PerformPhysicsTrace();

if (traceResult.Hit)
{
    // Check if the hit shape has a specific tag
    if (traceResult.Tags != null && traceResult.Tags.Contains("Enemy"))
    {
        // Perform some action if the hit object is tagged as an enemy
        HandleEnemyHit(traceResult);
    }
}