SceneTrace IgnoreGameObject( GameObject obj )

book_4_sparkGenerated
code_blocksInput

Description

The IgnoreGameObject method in the SceneTrace struct is used to exclude a specific GameObject from being hit during a trace operation. This is useful when you want to perform a trace but need to ignore certain objects in the scene, such as the object initiating the trace or objects that should not be considered for collision detection.

Usage

To use the IgnoreGameObject method, you need to have an instance of SceneTrace. Call the method with the GameObject you wish to ignore as the parameter. This method returns the modified SceneTrace instance, allowing for method chaining.

Example

// Example of using IgnoreGameObject
SceneTrace trace = new SceneTrace();
GameObject objectToIgnore = ...; // Obtain the GameObject to ignore
trace = trace.IgnoreGameObject(objectToIgnore);

// Continue setting up the trace
trace = trace.FromTo(startPosition, endPosition);

// Run the trace
SceneTraceResult result = trace.Run();