Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How do i change position every “x” seconds i want

  • How do i change position every “x” seconds i want

    Posted by Bar Avraham on June 24, 2017 at 9:14 pm

    Hey i have a layer that i want to change his position.
    I want this to change every “x” seconds i choose.

    I mean like:

    position=[200,500]
    wait “4” seconds
    now change to [200,600]
    wait “3” seconds
    now change to [200,790]
    …….

    Please help. Thank you very much ????

    Scott Mcgee replied 9 years, 2 months ago 2 Members · 1 Reply
  • 1 Reply
  • Scott Mcgee

    June 26, 2017 at 7:46 pm

    There’s probably an easier way to do this but if you know when you want it to move and for how long this is a messy way to do it

    valuea = [200, 500];
    valueb = [200,600];
    valuec = [200,790];
    valued = [500,790];

    inPointa = 0;
    outPointa = 2;
    inPointb = 4;
    outPointb = 6;
    inPointc = 8;
    outPointc = 10;

    if (time < outPointa){
    ease(time,inPointa,outPointa, valuea, valueb)
    } else if (time < outPointb){
    ease(time,inPointb,outPointb, valueb, valuec)
    } else if (time < outPointc){
    ease(time,inPointc,outPointc, valuec, valued)}

    If the transistion is always going to be the same you could probably reduce it to this


    valuea = [200, 500];
    valueb = [200,600];
    valuec = [200,900];
    valued = [500,900];

    inPointa = 0;
    inPointb = 4;
    inPointc = 8;

    if (time < inPointa + 2){
    ease(time,inPointa,inPointa +2, valuea, valueb)
    } else if (time < inPointb + 2){
    ease(time,inPointb,inPointb +2, valueb, valuec)
    } else if (time < inPointc +2){
    ease(time,inPointc,inPointc + 2, valuec, valued)}

    But there’s still probably a way to reduce it further or to write it in general, but I’m not that good.

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