Random between -1 and 1

I am trying to get a random float between -1 (inclusive) and 1 (inclusive).

I have tried Random.Range(-1, 1), but this just provides -0.1 or 0.

I have tried Random.Range(-1.0F, 1.0F), but this just provides between -0.1 and 0.1

Two questions:

Why are these the results?
How can I get a random float between -1 and 1?


I am just calling the Random methods in my update method and printing them out like such:

void Update(){
    float randomNumber = Random.Range(#, #) * 1;


It is not happening unless I multiply by 1…what???

Random.value gives you a random point between 0 - 1. Try


There you go. random from -1 to 1

Uhm, if i use your code (once fixed all typing errors) i get values between -1 and 1. Of course you have to use the float variant of the Range method, otherwise it will use the integer overload.

float randomNumber = Random.Range(-1f,1f);

So i can’t reproduce your results.