Move another mesh along a surface when animating
Here's one way, it's not perfect, because of the limitations of the Clamp To constraint.

Duplicate a central loop of your key, and Header &gt; Object Menu &gt;
convert it to a curve. Extend the curve to tip-base level on both sides.
Place the origins of your tumbler-pins at their tips.
Assign them each a Clamp To constraint, targeted on the curve.


(It's sensible to get this constraint working on one tumbler to begin with, after settling the curve, making sure its scale is applied, etc.)
Because of the way the constraint interpolates the curve, there's some drift in the horizontal direction. You can eliminate this with another constraint on the tumbler: Limit Location to fix it in all axes apart from  up-and-down.

If the whole lot is to be parented to other parts for rigging, it might be better to do that first.

the curve remains editable to make small adjustments to the pin positions, if necessary. Excuse the grotty .gif