rotationUniform
Returns a random rotation with uniform distribution (Read Only).
Read time 1 minuteLast updated 2 days ago
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public static Quaternion rotationUniform { get; }
Remarks
Employs Hopf fibration to return a random Quaternion within a uniformly distributed selection space. Gives higher quality results compared to the more naive approach employed by Random.rotation, though at a 40% performance cost.
Examples
using UnityEngine;public class Example : MonoBehaviour{ void Start() { // Sets a random orientation for the object. transform.rotation = Random.rotationUniform; }}