-
Expression for random rotation with angle limit
Hey guys,
I’m developping now my very first animation on After Effects and I would like to use expressions to add some random and smooth movement on my character.
This is the character:
What I wanna do is move some of these hair curls (each of them is an independent layer, of course) with a slight random rotation, but I need to have control on the amplitude of the rotation – some of these curls may rotate only 20 degrees, other can be less or more, i need to adjust these value for each one of them.
I’m using now this following code found here and the random movement seems great, but it’s way too fast and I have no idea how to put a value to control the amplitude of the rotation (I tried “amplitude = 30;” at the beginning and the end, but I didn’t work).
If someone knows how to help I’d very thankful 🙂
j = 0; //initialize loop counter
accum = 0; //initialize random accumulator
seedRandom(index,true)while (j < time){
accum += random(10);
j += thisComp.frameDuration;
}rotation + accum
