Random
.rotation
Manual
Reference
Scripting
Scripting
>
Runtime Classes
>
Random
Random
.rotation
Menu
Overview
Runtime Classes
Attributes
Enumerations
Editor Classes
Enumerations
History
Index
Random
All Members
Class Variables
insideUnitCircle
insideUnitSphere
onUnitSphere
rotation
seed
value
Class Functions
Range
static
var
rotation :
Quaternion
Description
Returns a random rotation
(Read Only)
.
JavaScripts
JavaScript
C#
Boo
// Instantiates a prefab with a random rotation at the world-origin
var
prefab :
GameObject
;
Instantiate(prefab,
Vector3.zero
,
Random.rotation
);
using UnityEngine;
using System.Collections;
public
class
example :
MonoBehaviour
{
public
GameObject
prefab;
void
Awake
() {
Instantiate(prefab,
Vector3.zero
,
Random.rotation
);
}
}
import
UnityEngine
import
System.Collections
class
example(
MonoBehaviour
):
public
prefab as
GameObject
def
Awake
():
Instantiate(prefab,
Vector3.zero
,
Random.rotation
)