Suggest a change
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Close
Declaration
public Int32 NextInt();
Returns
Int32
A uniformly random integer value.
Description
Returns a uniformly random int value in the interval [-2147483647, 2147483647].
Declaration
public Int32 NextInt(Int32 max);
Parameters
| Parameter |
Description |
| max |
The maximum value to generate, exclusive. |
Returns
Int32
A uniformly random int value in the range [0, max).
Description
Returns a uniformly random int value in the interval [0, max).
Declaration
public Int32 NextInt(Int32 min,
Int32 max);
Parameters
| Parameter |
Description |
| min |
The minimum value to generate, inclusive. |
| max |
The maximum value to generate, exclusive. |
Returns
Int32
A uniformly random integer between [min, max).
Description
Returns a uniformly random int value in the interval [min, max).