Jump to content
Sign in to follow this  
Igor Q.

Random Min (0) Max (0)

Recommended Posts

Hi

Could we please have a Random Min/Max options that does not use whole integers only? Thanks.

Share this post


Link to post
Share on other sites

Hi, you can use Random 0-1. If you need full range between 5 and 8 then just use <<Random 0-1> * <3>>+ <5>

Share this post


Link to post
Share on other sites
2 minutes ago, Houp said:

Hi, you can use Random 0-1. If you need full range between 5 and 8 then just use <<Random 0-1> * <3>>+ <5>

Whats the decimal range?

Share this post


Link to post
Share on other sites

You could also do something like this:  For a random between 0 and 10, with 2 decimal places, use Random 0-1000 then divide by 100.  (Actually, if you want it to include 1000, you should Random 0-1001)

Share this post


Link to post
Share on other sites
29 minutes ago, Indomitus said:

You could also do something like this:  For a random between 0 and 10, with 2 decimal places, use Random 0-1000 then divide by 100.  (Actually, if you want it to include 1000, you should Random 0-1001)

I already did this, but its cumbersome

Share this post


Link to post
Share on other sites

It uses: https://docs.unity3d.com/ScriptReference/Random-value.html so same as float number.

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×