SceneTrace Radius( float radius )

robot_2Generated
code_blocksInput

Description

The Radius method of the SceneTrace struct in the Sandbox API is used to configure a trace as a sphere with a specified radius. This method is part of the trace configuration process, allowing you to define the shape of the trace as a sphere, which can be useful for detecting collisions or interactions within a spherical area.

Usage

To use the Radius method, you need to have an instance of SceneTrace. Call the Radius method on this instance, passing in the desired radius as a float. This will configure the trace to use a spherical shape with the specified radius.

Example

// Example of using the Radius method
SceneTrace trace = new SceneTrace();
trace = trace.Radius(5.0f); // Sets the trace to a sphere with a radius of 5 units

// You can then run the trace to detect collisions
SceneTraceResult result = trace.Run();
if (result.Hit)
{
    // Handle the collision
}