Copy link to clipboard
Copied
The random(x) expression is simple enough to randomly rotate a layer to any angle, but what if I want that angle to be to the nearest 45 degrees? So my layer would randomly rotate to any of the following angles: 0, 45, 90, 135, 180, 225, 270, 315, or 360 degrees. Thanks, Jim
This should give you what you're looking for:
Math.floor(random(8))*45
I didn't include 360 because that's the same as 0, but if you want it, just change the 8 to a 9.
Dan
Copy link to clipboard
Copied
This should give you what you're looking for:
Math.floor(random(8))*45
I didn't include 360 because that's the same as 0, but if you want it, just change the 8 to a 9.
Dan
Copy link to clipboard
Copied
Dan, thank you for your help! Really appreciate the tip. Best, Jim
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more