Description
The LocalRotation
property of the GameTransform
class represents the rotation of a game object in local coordinates. This property is used to get or set the rotation relative to the object's parent, allowing for transformations that are independent of the world coordinate system.
Usage
To use the LocalRotation
property, you can access it directly from an instance of GameTransform
. This property is marked as obsolete, and it is recommended to use LocalRotation
directly instead of Transform.LocalRotation
.
Example
// Example of setting the local rotation of a GameObject
GameTransform transform = myGameObject.Transform;
transform.LocalRotation = Rotation.FromAxis(Vector3.Up, 45); // Rotate 45 degrees around the Up axis
// Example of getting the local rotation
Rotation currentRotation = transform.LocalRotation;