Random.value Manual     Reference     Scripting  
Scripting > Runtime Classes > Random
Random.value

static var value : float

Description

Returns a random number between 0.0 [inclusive] and 1.0 [inclusive] (Read Only).

Both 0.0 and 1.0 may be returned by this function.

JavaScripts
// Prints something between 0 and 1

print(Random.value);

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Awake() {
print(Random.value);
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Awake():
print(Random.value)