-
Expression to jump back into first position
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);