int num = Random.Range(min, max);
// Returns a number between 1 and 9 (inclusive, exclusive)
int randomInt = Random.Range(1, 10);
// Returns a number between -10.0 and 10.0 (inclusive, inclusive)
float randomFloat = Random.Range(-10.0f, 10.0f)
//If min is greater than max, the numbers are automatically swapped
var RandomValue = UnityEngine.Random.Range(min,max);
Debug.Log(Random.Range(1, 10); // Prints random number between 1 and 10
print(Random.Range(1, 10); // print also works
// random int
int randnum = Random.Range(2, 10)
// random float
float randnum = Random.Range(2.0f, 10.0f)
Random.Range(-10.0f, 10.0f)
public int number;
number = Random.Range(min, max);