I wasn’t sure where to send bug reports so am posting it here.
print(Random.Range(1, 4));
This never returns 4 and the documentation states it’s “inclusive” of the upper value. The work around is obviously to +1 to your upper range (or change the documentation
)
That’s not a bug; read the docs again (specifically, starting at halfway down the page). When reporting bugs (real bugs
), use the bug reporter app.
–Eric
Ah right cheers 
That leads me to another question as to why it’s designed like that?
“If max equals min, min will be returned.” - I understand why this is implemented this way.
“The returned value will never be max unless min equals max.” - Not sure about when you’d want this behaviour though!
That behavior allows you to write stuff like:
var objects : GameObject[];
function Start () {
Instantiate (objects[Random.Range(0, objects.Length)]);
}
When dealing with arrays, you often need to use Length-1, since they start at 0, so having the upper range of Random.Range be exclusive when using integers lets you not have -1s everywhere.
–Eric
Well in that respect it’s handy but a bit strange a bit like enforced streamlined code where it’s not really necessary. Especially when the documentation says “inclusive” of the upper value 
Still it’s hardly a deal-breaker - thanks for the explanation.
Except the docs don’t say that it’s inclusive of the upper value, they clearly say that it’s exclusive. Remember that we’re talking about ints, not floats.
–Eric
Documentation could be a bit better by using a better example for “Floats” that look like ints 
var position = Vector3(Random.Range(-10, 10), 0, Random.Range(-10, 10));
Heh, good catch, somehow I never noticed that. Yeah, the “float” example doesn’t use floats and won’t do what the comment claims…
–Eric