Activity › Forums › Adobe After Effects Expressions › Wiggle position along a path
-
Wiggle position along a path
Posted by Pierre-alexis Tremblay on October 2, 2013 at 3:41 pmLooking for a way to wiggle position along a path. Thanks.
P.A.T.
Pierre-alexis Tremblay replied 12 years, 7 months ago 3 Members · 6 Replies -
6 Replies
-
Pierre-alexis Tremblay
October 2, 2013 at 3:49 pmJust as a precison I want the object to move randomly along a path, not add a simple wiggle expression to a motion path.
P.A.T.
-
François Leroy
October 2, 2013 at 4:13 pmHi!
You can try with this expression:
François
t = key(numKeys).time;
valueAtTime(random(t)); -
Pierre-alexis Tremblay
October 2, 2013 at 4:55 pmThank you François.
It works but it would be even better if the movement could be smoother, if position along the path could be controlled with a wiggle expression.P.A.T.
-
François Leroy
October 2, 2013 at 5:06 pmThen, you can try with this:
and you can set the frequency, just like a wiggle.
Cheers,
Françoisfrequency = 2;seed = Math.floor(time*frequency);
start = seed/frequency;
stop = start + (1/frequency);t = key(numKeys).time;
seedRandom(seed,true);
rand1 = random(t);
seedRandom(seed+1,true);
rand2 = random(t);
easing = ease(time,start,stop, rand1, rand2);
valueAtTime(easing); -
Dan Ebberts
October 2, 2013 at 5:10 pmTry this:
freq = 1;
t = key(numKeys).time;
w = transform.rotation.wiggle(freq,100)-transform.rotation;
newT = linear(w,-100,100,0,t);
valueAtTime(newT)Dan
-
Pierre-alexis Tremblay
October 2, 2013 at 6:23 pmThanks guys both solutions are great.
The only other thing to make this totally perfect would be control over random seed.
Cheers.P.A.T.
Reply to this Discussion! Login or Sign Up