Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions swinging motion… how to i set the start value that isn’t Zero

  • Dan Ebberts

    April 10, 2013 at 9:29 pm

    When you look at this expression the graph editor, you’ll see a decaying sine wave. If you want it to start at maximum value, just change Math.sin() to Math.cos(). If you’re after something else, please describe what the curve should look like.

    Dan

  • Tylor Larson

    April 10, 2013 at 9:31 pm

    ok one last issue… how do i delay time… aka offset the start time of the swinging.

  • Dan Ebberts

    April 10, 2013 at 9:41 pm

    That depends on what you want to happen before the start time. This is one possibility:


    tStart = 1;
    swingMaxDistance = 75;
    if (time < tStart)
    swingMaxDistance;
    else{
    t = time - tStart;
    swingSpeed = 5;
    easeTimeSpan = 3
    easeSpeed = 1;
    easeVal = ease(t*easeSpeed, 0, easeTimeSpan, swingMaxDistance, 0);
    Math.cos(t*swingSpeed) * easeVal;
    }

    Dan

  • Tylor Larson

    April 10, 2013 at 9:49 pm

    that works. aways struggle with Else if statements. thanks again dan.

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