# drivers and curves

hey guys, i have a question. when animating a driver, the object that is the driver is going to follow a path and so is the object it’s driving. however it will also have rotating wheels. does that effect the rotation of the wheels?

-AJ

Probably yes, because if it is the direction of the object on the curve that is driving the wheel changes from the x-direction (for example) to the y-direction the wheel will not turn. You could use the rotation of the wheel to drive the offset constraint of the object on the curve. Here is a quick example.

CurveDriver.blend (487 KB)

Hi AJ,

been following your threads with interest. Been examining the pros and cons of differing methods of driving something, in my case a car rig, along a path.

In the end I’ve opted for a follow curve constraint and keying in the offset. This is the “strongest” follow path constraint it seems when working on curves with non applied modifiers. Shrinkwrap a curve onto a displacement modified plane for instance. Offset follows the modified curve, just keying in the curve direction doesn’t. Hmm if it’s not that one there is another where it fails.

My solution has been to key in the offset then use a script to calculate the distance travelled, and while doing that the velocity acceleration etc and keyframing them to custom properties. Things like wheel rotation can then be driven by these fcurves. I’ve attached a quick sample. Excuse the script i kinda just junked it in.

Change the curve path and the follow path constraints offset to move the plane. ReRun the script, it re keys displacement etc. Ultimately for me this method proved a lot easier than complicated drivers or framechange handlers. And its not much overhead running it once you decide on path and position on path over your frame range.

The sample only looks at the displacement of the wheel, it puts this displacement into the plane as well, I threw that in to visualise the fcurve. Now I’ve decided to go with this method, I’ll come up with a more generic script

The generated curves can be used to drive other objects. Simple examples for reverse lights and accelerator included. Steam discharge on the train for instance.

There is a slip/skid prop that will make the wheels under/over spin.

### Attachments

CurveDriver.blend (655 KB)