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 or filtering based on these identifiers.
Usage
Use the Tags
field to retrieve the tags associated with the hit shape in a scene trace. This can be useful for determining the type or category of the object that was hit, and for implementing logic based on these tags.
Example
// Example of accessing the Tags field from a SceneTraceResult
SceneTraceResult traceResult = PerformSceneTrace();
if (traceResult.Hit)
{
string[] hitTags = traceResult.Tags;
foreach (string tag in hitTags)
{
// Process each tag
if (tag == "Enemy")
{
// Handle enemy hit
}
}
}