Search Issue Tracker

By Design

Votes

0

Found in

5.5.1f1

Issue ID

902378

Regression

No

Random.value does not return 0.0f or 1.0f

Scripting

-

To reproduce:
1. Open attached Unity project "randomvalue.zip"
2. Open "doesnotreturn" scene
3. Go into Play mode

Expected result: By description, Random.value should include values from 0.0f to 1.0f [inclusive] , which means it should be possible to get 0.0f and 1.0f as a Random.value,
Actual result: it is impossible to get either of these values in any version of Unity.

Note: I attached a project which has a script. In that script I have made a loop that is generating random.value until it reaches either 0.0f or 1.0f.
pressing Play freezes Unity, which means that the loop is infinite which means Random.value never gets a value of 0.0f or 1.0f.

Reproduced on: 5.5.4p2, 5.6.2p3, 2017.1.0p2, 2017.2.0b4, 2017.3.0a1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.