Angles Random { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Angles.Random property provides a way to obtain a set of Euler angles representing a uniformly random rotation. This is useful in scenarios where you need to apply a random orientation to an object, such as in procedural generation or randomizing object rotations in a scene.

Usage

To use the Angles.Random property, simply access it directly as it is a static property. It will return an Angles object with random pitch, yaw, and roll values.

Example

// Example of using Angles.Random to get a random rotation
Angles randomAngles = Angles.Random;

// Use the random angles to set the rotation of a game object
GameObject myObject = new GameObject();
myObject.Rotation = randomAngles.ToRotation();

// Print the random angles
Log.Info($"Random Angles: Pitch = {randomAngles.pitch}, Yaw = {randomAngles.yaw}, Roll = {randomAngles.roll}");