Is Random.Range Biased?

I had a Random.Range(1,3);
Almost all the time, it would result in a 1.

Then I changed it to Random.Range(1,5);
Almost all the time, it results in a 2.

What is going on?!?! Why is Random.Range not working. Literally, I get 2 five times in a row each time I do Random.Range. UGHH!

NVM, I solved it!

For the record it’s not biased. It is maximum exclusive though.

for Record Random.Range

float β†’ public static function Range(min: float, max: float): float;
Returns a random float number between and min [inclusive] and max [inclusive] (Read Only).

int β†’ public static function Range(min: int, max: int): int;
Returns a random integer number between min [inclusive] and max [exclusive] (Read Only).

(source: Unity - Scripting API: Random.Range )

1 Like

Yep, i got it solved. THANKS GUYS <3