-
Wheel rotation expression problem
Hi,
I have a racing car animation with the wheels on the cars rotating based on their width and position in the x axis (based on the great tutorial by Carl Larsen – thanks Carl!). There’s also a random offset so the wheels are in a different rotational position on each car.
The expression is shown below.
The car and wheels are in their own comp which is then nested in the “main” comp which is a 3D comp. The wheels rotate correctly in the main comp when the car is dragged in the x axis (by physically moving the car in the comp window etc) BUT when the x position is animated (stopwatch turned on), the wheels don’t rotate although they do rotate in the correct way if I view the nested comp! It’s as if the nested comp isn’t getting updated correctly in the main comp.
What am I missing? Is it something to do with the nested comp referencing the main comp or a bug or something I don’t understand?
Any help MOST gratefully received 🙂
Thanks,
Paul.
d=width;
pi=Math.PI;
circ=d*pi;
rot=360/circ;
seedRandom(12346, true);
offset=random()*360;
movex= comp("Main").layer("blue car").transform.position[0];
scaler= comp("Main").layer("blue car").transform.scale[0]/100;
(rot*movex/scaler)+offset;