Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Rotation driving limited pingpong rotation

  • Rotation driving limited pingpong rotation

    Posted by Patrick Vaughan on January 28, 2008 at 5:02 pm

    What I’m having trouble doing is this…

    front wheel of bike “layer A’ rotates continuously
    for every 360 degrees I need rider’s body “layer B” to rotate from -15 deg to -5 deg and then back to -15 deg. I know how to link the two properties but not how to limit and “pingpong” the “layer b”. Any and all help is greatly appreciated.

    Patrick Vaughan replied 18 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Filip Vandueren

    January 28, 2008 at 6:21 pm

    Perhaps use a sine or cosine ? That will make a 0-360 value fluctuate between -1 and +1
    It’s smooth by nature, but it might be just the ticket:


    r=thisComp.layer("layer A").transform.rotation
    pingpong=Math.cos(degreesToRadians(r));
    linear(pingpong, -1, 1, -15, -5);

  • Patrick Vaughan

    January 28, 2008 at 7:00 pm

    knew a sine or cosine would do it just didn’t have the language down. This works perfectly thanks a ton.

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