Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Using a Slider to change the Speed of an object moving along a path.

  • Using a Slider to change the Speed of an object moving along a path.

    Posted by Luke Ritson on October 24, 2011 at 4:22 pm

    Hi Guys,

    Any expression in which i can link the speed and velocity of an object moving along a path with a slider control, eg. the higher/lower the value, the faster/slower it moves along the path

    Dan Ebberts replied 14 years, 10 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    October 24, 2011 at 5:24 pm

    You could control percentage of path traveled pretty easily, but controlling speed is tricky because you need to loop through all the previous frames to see what the speed was at that frame and accumulate the results to calculate the total travel. Do-able but messy and potentially slow.

    Dan

  • Luke Ritson

    October 24, 2011 at 5:30 pm

    Ok percentage travelled would work better actually, how would i go about making that expression?

  • Dan Ebberts

    October 24, 2011 at 5:39 pm

    This Position expression should work:


    pct = effect("Slider Control")("Slider");
    if (numKeys > 1){
    t0 = key(1).time;
    t1 = key(numKeys).time;
    t = linear(pct,0,100,t0,t1);
    valueAtTime(t);
    }else{
    value
    }

    The slider will be more accurate if you make the keyframes roving.

    Dan

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