Activity › Forums › Adobe After Effects › Random motion/speed around comp then back to original position
-
Random motion/speed around comp then back to original position
Posted by Adam Fram on November 5, 2015 at 7:27 pmI have some particles to move around randomly in a scene that loops, so I can’t use Particular or other particle simulators. Any suggestions for expressions that will move each piece smoothly and randomly around the comp at varying speeds, returning to it’s original position at the end of a specified duration?
Adam Fram replied 10 years, 6 months ago 2 Members · 4 Replies -
4 Replies
-
Kevin Camp
November 6, 2015 at 12:02 amactually, creating a looping particle system is very easy. search the cow’s ae tutorials for ‘looping particle’ for a straight forward tutorial.
Kevin Camp
Art Director
KCPQ, KZJO & KRCW -
Adam Fram
November 6, 2015 at 12:15 amAh yes that would work for most particle effects but I need the same particles to each return to their original position as if they are flying in elaborate looped circles. I’m basically simulating fireflies dancing around the screen but they should return to their initial position to complete the loop without having them die off and be replaced by new particles. Is there a script to give random smooth motion around the comp and then return to their original spot, using a seed to ensure each layer is on a different trajectory?
-
Kevin Camp
November 6, 2015 at 12:54 amyou could use a wiggle() expression on one of your firefly layers, but tie the wiggle amount to a slider and keyframe the slider to go from 0, to some amount, then back to 0.
add a slider to your firefly and keyframe it to go from 0 to 500 to 0.
add an expression to the firefly’s position property and add this expression:
amount = effect(“Slider Control”)(“Slider”);
wiggle(1,amount)the layer should go from static to flying about and then back to static, resting in the same place that it started.
Kevin Camp
Art Director
KCPQ, KZJO & KRCW -
Adam Fram
November 9, 2015 at 11:41 pmThanks Kevin, that works pretty well. I used that idea coupled with Dan Ebberts’ genius scripting below:
freq = 1;
amp = 110;
loopTime = 3;
t = time % loopTime;
wiggle1 = wiggle(freq, amp, 1, 0.5, t);
wiggle2 = wiggle(freq, amp, 1, 0.5, t – loopTime);
linear(t, 0, loopTime, wiggle1, wiggle2)I scripted the frequency, amplitude and loopTime to sliders so I could control them across dozens of layers for a random but seamless loop. Thanks everyone!
Reply to this Discussion! Login or Sign Up