The WithCollisionRules
method in the SceneTrace
struct allows you to configure a trace to use the collision rules associated with objects that have specific tags. This method is useful when you want to perform a trace that respects the collision settings of certain tagged objects in the scene.
To use the WithCollisionRules
method, you need to specify the tag of the objects whose collision rules you want to apply, and a boolean indicating whether to treat the objects as triggers.
For example, if you want to trace using the collision rules of objects tagged as "Player" and treat them as triggers, you would call:
SceneTrace trace = new SceneTrace();
trace = trace.WithCollisionRules("Player", true);