Description
The WithTag
method in the SceneTrace
struct is used to filter entities based on a specific tag. When this method is called, it configures the trace to only consider entities that have the specified tag. If multiple calls to WithTag
are made, the trace will require entities to have all specified tags to be considered a match.
Usage
Use the WithTag
method when you want to narrow down the entities that a trace will consider by specifying a tag. This is particularly useful in scenarios where you want to interact with or detect only certain types of entities within a scene.
Example
// Example usage of WithTag method
SceneTrace trace = new SceneTrace();
trace = trace.WithTag("Player");
// Run the trace
SceneTraceResult result = trace.Run();
if (result.Hit)
{
// Do something with the hit result
}