-
little swing rotation on car mouvement
I want to simulate the suspension of a car… When the car stops I want to make the body of the car to rotate a little bit towards the front. And when it accelerate I want the car to rotate towards the back a little bit.
For the wheels I already have the expression to make them rotate base on the x pos of the car (see code below).
The difference is that the wheels will be parented to a null and the car to the same null so I can rotate the body without moving the wheels.
I hope I’M clear enough. 🙂Anyway, my guess is there will be a if/else expression for the rotation of the body but I don’t know how to tell when to stop and when to start the rotation.
If someone can help… thanks in advance. 🙂
d=width;
pi=Math.PI;
circ=d*pi;
rot =360/circ;
movex=thisComp.layer(*layer*).transform.position[0];
scaler=thisComp.layer(*layer*).transform.scale[0]/100;
rot*movex/scaler