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 hit shape, allowing for more detailed and context-specific handling of trace results.
Usage
To access the Tags
field, you need to have an instance of PhysicsTraceResult
. Once you have the instance, you can directly access the Tags
field to retrieve the array of tags associated with the hit shape.
Example usage:
PhysicsTraceResult traceResult = PerformPhysicsTrace();
string[] hitTags = traceResult.Tags;
foreach (string tag in hitTags)
{
// Process each tag
if (tag == "Enemy")
{
// Handle enemy-specific logic
}
}
Example
PhysicsTraceResult traceResult = PerformPhysicsTrace();
string[] hitTags = traceResult.Tags;
foreach (string tag in hitTags)
{
// Process each tag
if (tag == "Enemy")
{
// Handle enemy-specific logic
}
}