Description
The LocalRotation
property of a GameObject
represents the rotation of the object relative to its parent. This property is crucial for determining the orientation of the object within its local coordinate space, which is particularly useful when the object is part of a hierarchy of objects.
Usage
To access or modify the local rotation of a GameObject
, you can use the LocalRotation
property. This property is of type Rotation
, which allows you to set or get the rotation in terms of quaternions.
Example usage:
GameObject myObject = new GameObject();
myObject.LocalRotation = new Rotation(0, 90, 0); // Sets the local rotation to 90 degrees around the Y-axis
Rotation currentRotation = myObject.LocalRotation; // Retrieves the current local rotation
Example
GameObject myObject = new GameObject();
myObject.LocalRotation = new Rotation(0, 90, 0); // Sets the local rotation to 90 degrees around the Y-axis
Rotation currentRotation = myObject.LocalRotation; // Retrieves the current local rotation