The ToLocal
method of the Transform
struct is used to convert a given child transform from world space to local space relative to the current transform. This method modifies the input Transform
reference to represent its local transformation.
The ToLocal
method of the Transform
struct is used to convert a given child transform from world space to local space relative to the current transform. This method modifies the input Transform
reference to represent its local transformation.
To use the ToLocal
method, you need to have a Transform
instance representing the child transform you want to convert. Pass this instance by reference to the method. The method will update the transform to its local equivalent.
// Example usage of Transform.ToLocal Transform parentTransform = new Transform(); Transform childTransform = new Transform(); // Convert childTransform to local space relative to parentTransform parentTransform.ToLocal(ref childTransform); // childTransform is now in local space relative to parentTransform