SceneTrace Ray( Vector3& from, Vector3& to )
SceneTrace Ray( Ray& ray, System.Single& distance )

robot_2Generated
code_blocksInput

Description

The Ray method in the SceneTrace struct is used to cast a ray from a starting point to an ending point within the scene. This method is useful for detecting intersections or collisions along the path of the ray.

Usage

To use the Ray method, you need to provide two Vector3 parameters, from and to, which represent the starting and ending points of the ray, respectively. The method returns a SceneTrace object that can be further configured or executed to perform the trace.

Example

// Example of using the Ray method
Vector3 startPoint = new Vector3(0, 0, 0);
Vector3 endPoint = new Vector3(10, 0, 0);

SceneTrace trace = new SceneTrace();
SceneTrace result = trace.Ray(ref startPoint, ref endPoint);

// Further configuration or execution of the trace can be done here
SceneTraceResult traceResult = result.Run();

// Check if the trace hit something
if (traceResult.Hit)
{
    // Handle the hit result
    var hitPosition = traceResult.Position;
    // Additional logic here
}