Force Random Rotator to be positive (or within a range)

I’m using a Random rotator to set the rotation of my shots. I would like to find a way of getting a random rotation, either within a range, or at the very least, force it to be non-negative. Is this possible?

Two ways you could do it:

My suggested way, which is to use 3 Random Float in Range nodes, and tie them into a Make Rot.


The other method, which I don’t recommend, but could maybe help you out as far as understanding a couple nodes you might not know about: Use a Break Rot to get the floats of Pitch, Yaw, and Roll. You could then use Absolute (absolute value of float) to prevent it from being negative, or a Clamp to set it’s minimum and maximum values. Use a Make Rot to tie them back together. The only problem with this method is if the random values generated were ever 0 (for Absolute) or outside of the range (for Clamp), they would just be set to 0 or those range limits. You’ll end up with a higher chance of those limits than every value being equally random.

1 Like