Ridged body rack & pinion problem

I am just starting to learn about rigid body physics and I am working with a simple file (uploaded) which contains two objects, a rack & pinion gear set.

The pinion is set to rotate only (Y axis) and the rack is limited to move only up and down (Z axis).

When I animate, I expect the rack to fall down, causing the gear to turn. Instead the gear rotates first and in the wrong direction, and the rack moves up. The two pass through one another rather than keeping the teeth coordinated.

I keep adjusting settings, but nothing works. I reversed gravity but that had no effect.

Thanks for any clues.

Attachments

GEARS 2.blend (744 KB)


There are a few problems with your setup. The scale of all the objects should be 1 so you need to to apply scale (Ctrl-A scale), the 2 gears are too close together so you need to separate them a little, and the Shape in the Rigid Bodies Collisions panel should be set to Mesh for both gears. Hope this helps.

GEARS 3.blend (740 KB)

AlanK,
Thank you very much. Everything working well now.