# rotation

> Returns a random rotation (Read Only).

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static Quaternion rotation { get; }
```

### Remarks

Randomize the `x`, `y`, `z`, and `w` of a [Quaternion](/engine/6000.7/script-reference/unityengine/quaternion.md) each to \[-1.0..1.0] (inclusive) via [Random.Range](/engine/6000.7/script-reference/unityengine/random/range.md) and normalize the result. See also [Random.rotationUniform](/engine/6000.7/script-reference/unityengine/random/rotationuniform.md) for a slower but higher quality algorithm.

### Examples

```csharp
using UnityEngine;

// Click the "Rotate!" button and a rotation will be applied

public class ExampleClass : MonoBehaviour
{
    void OnGUI()
    {
        if (GUI.Button(new Rect(10, 10, 100, 50), "Rotate!"))
        {
            transform.rotation = Random.rotation;
        }
    }
}
```
