Rotation Rotation { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Rotation property of the GameTransform class represents the rotation of a game object in world coordinates. This property is marked as obsolete, and it is recommended to use WorldRotation instead for accessing or modifying the rotation in world space.

Usage

To access the rotation of a game object in world coordinates, use the WorldRotation property instead of Rotation. The Rotation property is maintained for backward compatibility but is not recommended for use in new code.

Example

// Example of accessing the rotation of a GameObject using the recommended property
GameTransform transform = myGameObject.Transform;
Rotation worldRotation = transform.WorldRotation; // Use WorldRotation instead of Rotation

// Example of setting the rotation
transform.WorldRotation = new Rotation(0, 90, 0); // Set rotation to 90 degrees around the Y-axis