Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Use Slider Control to move y axis of multiple objects at different times?

  • Use Slider Control to move y axis of multiple objects at different times?

    Posted by Stephen Roberts on May 30, 2015 at 1:21 pm

    Hi There!

    I’ve use this expression to change the scale of several objects over time:

    delay =thisComp.layer(“Sliders”).effect(“Delay amount”)(“Slider”);
    d = delay*index;
    t = time-d;
    exp = thisComp.layer(“Sliders”).effect(“Scale”)(“Slider”).valueAtTime(t);
    [exp,exp]

    But now I need to move several objects (colored squares all sitting on the bottom of the comp) up and off the screen at different times.

    I applied this expression to just the y axis and it works, EXCEPT that the object “jumps” to the to Y position. it doesn’t tween.

    delay = thisComp.layer(“Sliders”).effect(“Position”)(“Slider”);
    d = delay*index;
    t = time-d;
    exp = thisComp.layer(“Sliders”).effect(“Position”)(“Slider”).valueAtTime(t);

    any thoughts?

    Stephen Roberts replied 11 years, 2 months ago 3 Members · 8 Replies
  • 8 Replies
  • Mark Boszko

    May 30, 2015 at 4:28 pm

    I just did a bunch of similar animations, and if you’re doing the movement with the expression, you’ll likely also need to do the tweening in the expression with a linear() or ease() calculation vs. time.

    —–

  • Dan Ebberts

    May 30, 2015 at 5:24 pm

    In the second version it looks like you’re using the same slider for both the delay and the position, which isn’t the way you have the first example set up. Was that intentional?

    Dan

  • Stephen Roberts

    May 30, 2015 at 8:52 pm

    Thanks Mark and Dan!

    Dan, you were right… i just needed to rename that first slider to “Delay amount”

  • Stephen Roberts

    May 30, 2015 at 9:15 pm

    It works… but not the way I need it to.

    I have a mass of triangles scattered throughout the screen (see attached). I want them all to fly up out off the screen.

    But when I use this expression, they all drop to the bottom of the screen (they all start at the same y value). I need them to start at their current y position.

    any thoughts?

    screenshot2015-05-30at5.07.41pm.png

    delay = thisComp.layer("Sliders").effect("Delay amount")("Slider");

    d = delay*index;
    t = time-d;
    exp = thisComp.layer("Sliders").effect("Position")("Slider").valueAtTime(t);

  • Dan Ebberts

    May 31, 2015 at 12:24 am

    That doesn’t look like a position expression, so I’m not sure how you have things set up, but my guess is you’d need to add a line like this to the end:

    value – [0,exp]

    Dan

  • Stephen Roberts

    May 31, 2015 at 1:05 am

    Nice one Dan! … that did the trick. Thanks much.

  • Mark Boszko

    May 31, 2015 at 2:45 am

    Oops — sorry if I steered you wrong!

    —–
    https://opticalpodcast.com

  • Stephen Roberts

    May 31, 2015 at 2:56 am

    no problem ! i’m just too inexperienced to try your method. thanks for the reply

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy