ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# Animating 2-Points to a Motion Path

FAQ   •   VIEW ALL
 Animating 2-Points to a Motion Path on Oct 24, 2011 at 3:06:07 pm

Hello,

So i have an issue using a motion path. Lets for example say, i have a car, two wheels in a fixed position that rotates on the Z-Axis. What i want to be able to do is, when this car hits a hill or a curve, that both wheels are fixed to that curve.

So far my motion path / auto-orient allows for just one of these points to behave correctly. The only way to make it work completely is to turn auto-orient off and keyframe the rotation, which is a time consuming mess.

So the basic question is, how can i, if possible, allow a single object to pass through a motion path along not 1, but 2 points.

Thanks,

 Re: Animating 2-Points to a Motion Pathon Oct 24, 2011 at 3:21:15 pm

Could you parent one wheel to the other or parent both wheels to a null and animate that on the path?

 Re: Animating 2-Points to a Motion Pathon Oct 24, 2011 at 3:31:26 pm

It is a single object, imagine a straight line, the length of which is fixed, but the rotation of each point needs to follow a path. After Effects however only works with a single anchor point so in the end only one end would rotate.

Let me show you an example: Rear is attached to path, front is not.

The Goal: to have both attached to the path:

Hope this helps.

 Re: Animating 2-Points to a Motion Pathon Oct 24, 2011 at 4:06:04 pm

I'm not sure you can achieve this just by linking to Nulls- posting a question on the Expressions forum may get you some good answers.
On great plugin to try is Newton- real world physics for 2d.
http://www.motionboutique.com/en/shop

Tudor "Ted" Jelescu
Senior VFX Artist

 Re: Animating 2-Points to a Motion Pathon Oct 24, 2011 at 3:28:15 pm

Can you maybe duplicate the Wheel and Path and offset the Wheel layer by a few frames? Of course that would only work for constant speed...

Tudor "Ted" Jelescu
Senior VFX Artist

 Re: Animating 2-Points to a Motion Pathon Oct 24, 2011 at 8:34:51 pm

This is doable.

Ensure that the car's main body has its Anchor Point at the bottom of its chassis.

Parent all of the car's assets (wheels and whatever else that is on its own layer and is part of the car) to the car's main body. Apply Auto-orient along path to the main body.

That's it!

If you want your wheels to rotate based on the speed of the car, then apply the following Expression to each wheel's z-rotation -
//
d=width;
pi=Math.PI;
circ=d*pi;
rot=360/circ;
CarChassis=thisComp.layer("carBody").transform.position[0];
Scalar=thisComp.layer("carBody").transform.scale[0];
rot+(75)*CarChassis/scalar

//

HTH
RoRK

Intensive AE & Mocha Training in Singapore and Malaysia.