Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17118

randomRange() never return the maximum value of range

$
0
0

Hi.

I am trying to generate a random value in range 0.00 and 0.09 using the cc.math.randomRange() method. However, for some reason, the value the method return, never go above 0.06, I need to set the maximum value to 0.15 to force it to go up to 0.09. But obviously it is not optimal as if the method return any value above 0.09, it would be invalid in my app.

Not sure why is this happening. is there any better solution to this?

Thank you.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 17118

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>