Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions how to reset a value at a certain time

  • how to reset a value at a certain time

    Posted by John Ord on July 22, 2010 at 4:58 pm

    Hi guys, i have a bit of a quandry herei wonder if you could help me.

    i have a null object that starts off +3000 on the z axis.
    It the uses time to increment the z position coming toward the camera.
    Once it reaches +3000 i wish to reset the z position to -3000 and let the loop begin again.

    It works fine however when it gets over -3000, it resets to 3000 and stays there.

    i have attached my code, any help would be great.

    cheers
    chris

    t=time;
    a= thisComp.layer("Null").position[0];
    b= thisComp.layer("Null").position[1];
    c= thisComp.layer("Null").position[2]-(t*500);

    if(c <= -3000) {
    c=3000;
    t=0;
    }
    [a,b,c]

    John Ord replied 15 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    July 22, 2010 at 5:33 pm

    something like this should work:

    value – [0,0,(time*500)%6000]

    Dan

  • John Ord

    July 22, 2010 at 5:36 pm

    Ah, brilliant you sir, are a gent

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