Description
The HitTriggers
method in the SceneTrace
struct is used to configure the trace to include trigger entities in its results. This method is part of the filtering options available for scene tracing, allowing you to specify whether or not trigger entities should be considered during the trace operation.
Usage
To use the HitTriggers
method, simply call it on an instance of SceneTrace
when setting up your trace. This will ensure that any trigger entities encountered during the trace are included in the results.
Example
// Example of using HitTriggers in a SceneTrace
SceneTrace trace = new SceneTrace();
trace = trace.HitTriggers();
// Continue setting up the trace as needed
trace = trace.FromTo(startPosition, endPosition);
// Run the trace
SceneTraceResult result = trace.Run();
// Check if a trigger was hit
if (result.Hit)
{
// Handle the hit
GameObject hitObject = result.Entity;
// Do something with the hit object
}