Randomize Values by Range and integers

Randomize Value by Range doesn’t quite work with integers. Consider what happens when you try get a random integer between 0 and 7.

Randomize Value by Range was not designed to work with integers. By forcing it to integer type, you end up with a Random Value node that has a mean of 3 and a variance of 4 (hence the -1, which is the result of 3 – 4).

A Random Value node with a mean of 4 and a variance of 3.5 would give you an integer between 0 and 7 (because when you force the random value into an integer, ICE truncates the scalar, so 7.5 would be 7, 0.5 would be 0).

A better way may be to use Floor on the scalar output of Random Value. I know some users have done their own Randomize Integer by Range compounds.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s