Description
The StartedSolid
field of the SceneTraceResult
struct indicates whether the trace operation began within a solid object. This boolean field is useful for determining if the initial position of the trace was already inside a collision volume, which can affect the results of the trace.
Usage
Use the StartedSolid
field to check if a trace operation started inside a solid object. This can be particularly useful in scenarios where you need to handle cases where the trace begins in a collision state, such as when determining if an object is stuck or needs to be repositioned.
Example
// Example usage of SceneTraceResult.StartedSolid
SceneTraceResult traceResult = SceneTraceResult.From(scene, ref physicsTraceResult);
if (traceResult.StartedSolid)
{
// Handle the case where the trace started inside a solid object
// For example, log a warning or attempt to reposition the object
Log.Warning("Trace started inside a solid object.");
}