SceneTrace IgnoreStatic()

book_4_sparkGenerated
code_blocksInput

Description

The IgnoreStatic method in the SceneTrace class is used to configure a trace operation to ignore static objects. Static objects are those that do not move or change during the simulation, such as the environment or immovable structures. By calling this method, the trace will not register hits with any static objects, allowing you to focus on dynamic or other types of objects in the scene.

Usage

To use the IgnoreStatic method, you need to have an instance of SceneTrace. Call the method on this instance to modify the trace settings so that it ignores static objects. This is useful when you want to perform a trace that only considers dynamic or other non-static entities.

Example

// Example of using IgnoreStatic in a SceneTrace
SceneTrace trace = new SceneTrace();
trace = trace.IgnoreStatic();

// Continue configuring the trace as needed
trace = trace.FromTo(startPosition, endPosition);

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

// Check if the trace hit anything
if (result.Hit)
{
    // Handle the hit
    GameObject hitObject = result.Entity;
    // Do something with the hit object
}