Closed Ray2r closed 3 years ago
The Random Integer command uses Unity's Random.Range() function which, when using integers, is exclusive, meaning it does not include the max value in the random. Floats are inclusive so the Random Float command should include the max value.
This is a standard behaviour of getting random numbers using Random.Range() with integers so it's not necessarily a bug and some code relies on this. For the sake of simplicity and consistency, adjusting the command may not be needed.
You could increase your max value to account for this, or alternatively change the Random Integer command so it uses maxValue.Value + 1 instead. This way, you can enter 3 and it should include that value.
Ahh, thanks for that @Arylos07.
Describe the bug The Random Integer action does not use the Max Value integer inputted.
To Reproduce If Min Value = 1 and Max Value = 3. The Random Integer will only randomize between 1 and 2 but NOT 3.
Expected behavior The Random Integer should choose between 1, 2 and 3 not just 1 and 2.
Additional context I think the same applies to Random Float. But I cannot be certain as Random Float goes to 8 decimal places.