Rotation LocalRotation { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The LocalRotation property represents the local rotation of the game object to which this component is attached. It is expressed as a Rotation object, which defines the orientation of the game object relative to its parent.

Usage

Use the LocalRotation property to get or set the local rotation of a game object. This property is useful when you need to manipulate the orientation of a game object in relation to its parent, without affecting its global orientation.

Example

// Example of setting the local rotation of a component
Component myComponent = new Component();
myComponent.LocalRotation = Rotation.FromAxis(Vector3.Up, 45.0f); // Rotates the object 45 degrees around the Up axis

// Example of getting the local rotation of a component
Rotation currentRotation = myComponent.LocalRotation;

// Example of modifying the local rotation
myComponent.LocalRotation *= Rotation.FromAxis(Vector3.Right, 90.0f); // Adds a 90-degree rotation around the Right axis