Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Leaf falling expression to a stop

  • Leaf falling expression to a stop

    Posted by Davi Herold on May 22, 2019 at 7:56 am

    I came across this expression for emulating the falling of leaves. However, it just keeps “falling” forever. I was wondering if there is anyway of making it stop after some point, i.e., when ‘y’ is bigger than a specific value, say 1080 (the border of the screen.

    position

    sp=2;
    amp=150;
    gravity = 50;
    x = Math.sin(time*sp)*amp;
    y= time*time*gravity;
    value + [x,y];

    rotation:

    sp=2;
    amp=5;
    x = Math.sin(time*sp)*amp;
    value – x;

    Davi Herold replied 6 years, 12 months ago 1 Member · 1 Reply
  • 1 Reply
  • Davi Herold

    May 22, 2019 at 9:40 am

    Just an update, I did find a solution for the “height” value. I renamed the variables in the Comp a little bit (its name is “Shape Layer 4”). I came up with this:

    x = thisComp.layer("Shape Layer 4").transform.position.valueAtTime(time)[0];
    y = thisComp.layer("Shape Layer 4").position.valueAtTime(time)[1];

    sp=2;
    amp=150;
    gravity = 50;
    a = Math.sin(time*sp)*amp;
    b = time*time*gravity;

    if (b >= 900)

    value + [a,900]

    else

    value + [a,b];

    However, I still don’t know how to make the “Length” value pause, because I’d need a way to make it stop going from side to side, but at the value it was when it reached that point.

    I’d also probably need to do something similar to the rotation.

    Anyone has any ideas?

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