Random int Value

I'm making a game (aren't we all? ;) ) and I need a random value. I know how to do this with `Random.Range`, but for my game I need an `int` type, not `float`. Is there a way to round a `float` value to an `int` this in javascript with a rounding function or even just using the `Random` class? Thanks in advance!

Hi, its in the docs, but its important to mention the exclusive and inclusive difference. If using floats, the min and max value are inclusive, if using integers, the max value is exclusive.

Examples:
When defining Random.Range(1.0f, 3.0f) we will get results from 1.0 to 3.0
When defining Random.Range(1,3) we will get results from 1 to 2

Regards

Random.Range returns an int if you use it with integers. Random.Range in the docs

you allways need to add one to he top number
just the way unity works