The ToLocal
method of the Ray
struct transforms the ray from world space to local space using the provided Transform
reference. This is useful when you need to work with rays in the local coordinate system of a specific object or component.
The ToLocal
method of the Ray
struct transforms the ray from world space to local space using the provided Transform
reference. This is useful when you need to work with rays in the local coordinate system of a specific object or component.
To use the ToLocal
method, you need to have a Ray
instance and a Transform
reference. The method will return a new Ray
that represents the original ray in the local space of the given transform.
// Assume 'ray' is a Ray instance and 'transform' is a Transform instance Ray localRay = ray.ToLocal(ref transform); // Now 'localRay' is the representation of 'ray' in the local space of 'transform'.