Description
The WithCollisionRules
method in the SceneTrace
struct allows you to specify collision rules based on tags. This method is useful when you want to perform a trace that respects the collision settings of objects with specific tags. You can also specify whether the trace should consider the objects as triggers.
Usage
To use the WithCollisionRules
method, you need to call it on an instance of SceneTrace
. Provide the tag of the objects whose collision rules you want to use, and a boolean indicating whether to treat the objects as triggers.
Example
// Example of using WithCollisionRules
SceneTrace trace = new SceneTrace();
trace = trace.WithCollisionRules("Player", true);
// Now you can run the trace with the specified collision rules
SceneTraceResult result = trace.Run();