Description
The WithoutTags
method of the MeshTraceRequest
struct allows you to specify a set of tags that should be excluded from the ray tracing operation. This method is useful when you want to perform a ray trace but ignore certain objects that are associated with specific tags.
Usage
To use the WithoutTags
method, call it on an instance of MeshTraceRequest
and pass an array of strings representing the tags you want to exclude. This method returns a modified MeshTraceRequest
instance that can be used to run the trace.
Example
// Example usage of the WithoutTags method
var traceRequest = new MeshTraceRequest();
// Exclude objects with the tags "enemy" and "obstacle"
traceRequest = traceRequest.WithoutTags(new string[] { "enemy", "obstacle" });
// Run the trace
var result = traceRequest.Run();
// Check if the trace hit something
if (result.Hit)
{
// Handle the hit result
}