on Dec 7, 2016 at 9:42:42 pm Last Edited By David Jouppi on Dec 7, 2016 at 10:21:23 pm
Im running into a problem with an "if else" command. I have around 100 objects in a comp that I'm trying to assign a random rotation speeds to. I want them to either rotate to the left or the right. Additionally, regardless of which direction they're rotating, I want them to stay within a speed range, so that I can avoid having any of them standing totally still, or moving wayyyy to fast. I wrote out the following experession, which I figured should work, however, they always end up rotating in the same direction. Anyone know whats going on? I deduced the problem is happening at the the 3rd line. I cant get variable "drctn," to result in anything besides the value: -1. I assume I'm using the "if else" command incorrectly.
rndmA = Math.round(random(1,2));
if ( rndmA = 1 ) [drctn=-1] else [drctn=1];
animSpd = random(20,60);
time * (animSpd*drctn)