Returns a random rotation (Read Only).
// Sets a random orientation for the object. transform.rotation = Random.rotation;
using UnityEngine;
// Click button and a rotation will be applied
public class ExampleClass : MonoBehaviour { void OnGUI() { if (GUI.Button(new Rect(10, 10, 100, 50), "rotation")) { transform.rotation = Random.rotation; } } }