Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to jump back into first position

  • Expression to jump back into first position

    Posted by Chris Saez on April 2, 2019 at 4:31 am

    Hey everybody,

    I’m trying to set up an expression on the X-Position property to be linked to a rotation property on a null to have it move with the rotation to give a fake 3D effect.

    The problem I’m having is that I can get the layer move from point A to point B but when the rotation goes over 360, I don’t know how to put the layer back into the beginning position and move along with the rotation going over 360 to loop.

    So far this is what I have:

    r = thisComp.layer("RocketShip - Rotator").transform.yRotation;
    p = transform.xPosition;

    if (r<360)
    linear(r,90,360,p+180,p)
    else
    linear(r,360,720,p,p-180);

    Andrei Popa replied 7 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Andrei Popa

    April 2, 2019 at 7:54 am

    Not entirely sure about what you want to achieve, but this could be helpful. Modify maxDistance for a wider circle

    r = thisComp.layer("RocketShip - Rotator").transform.yRotation;
    maxDistance = 1000;

    value - Math.sin(Math.PI*r/180)*maxDistance;

    Andrei
    My Envato portfolio.

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