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.
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.
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.
// 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;