Videogames Development – Unity – Random Numbers

Assign this code to an Empty Object in the Scene:

#pragma strict

var x : float;


function Start()
{
    x = Random.Range(-10.0, 10.0);
}

function Update()
{
    Debug.Log(x);
}

Statement:
x = Random.Range(-10.0, 10.0); -> static function Range(min: float, max: float): float; -> The result is a float numer as: 1.986345