Description
The IgnoreGameObject
method is part of the SceneTrace
struct in the Sandbox API. This method allows you to specify a GameObject
that should be ignored during a scene trace operation. When a trace is performed, any interactions with the specified GameObject
will be excluded from the results, effectively making the object invisible to the trace.
Usage
To use the IgnoreGameObject
method, you need to have an instance of SceneTrace
. Call the method on this instance, passing the GameObject
you wish to ignore as a parameter. This method is useful when you want to perform a trace that should not consider certain objects, such as when you want to trace around a player character without detecting the character itself.
Example
// Example of using IgnoreGameObject
SceneTrace trace = new SceneTrace();
GameObject player = GetPlayerGameObject();
trace.IgnoreGameObject(player);
// Now perform the trace
SceneTraceResult result = trace.Run();
// The result will not include any hits with the player GameObject.