static Rotation FromYaw( float yaw )

robot_2Generated
code_blocksInput

Description

The FromYaw method creates a Rotation instance representing a rotation around the Y-axis (yaw) by a specified angle in degrees. This method is useful for generating rotations that only affect the yaw component, leaving pitch and roll unchanged.

Usage

Use this method when you need to create a rotation that only involves a change in the yaw angle. This is particularly useful in scenarios where you want to rotate an object around its vertical axis, such as turning a character to face a different direction.

Example

// Create a rotation with a yaw of 90 degrees
Rotation rotation = Rotation.FromYaw(90.0f);

// Use the rotation in a scene
GameObject myObject = new GameObject();
myObject.Transform.Rotation = rotation;