# Line of Bones to Travel and Conform to Curve (Train or snake following path)

I've searched google extensively on this. Can't seem to find an answer.

I know about spline IK, which is wonderful for conforming a row of bones to a path. But combining the armature object with a follow path modifier causes the point of origin to move, but the bones themselves stick to the beginning of curve.

Ultimately my goal is to make a creature like a snake or centipede follow a curve path, thus animating it fairly realistically ...

Mesh and curve modifier.

Once set up, can travel along curve by displacing our dummy edge object

Having tried a method similar to @moonboots answer in writing a train addon found using the method outlined below kept the wheels on track (better if the curve is too tight nothing will help). This may not matter too much with a deforming object like a snake. However it only requires making one very simple mesh object, with vertex groups as tagets for bone constraints.

Trying to place empties on the curve with offsets will cause the "train to derail" as the offset is looking at curve length rather than where the line segment next meets the curve. For example a unit circle radius 1, can hold a square with edge lengths sqrt(2) each corner touches the circle. The arc length is p1 / 2 Trying to get the empty locations right on a complex curve is IMO too hard. If a mesh is created and threaded onto a curve with a modifier the edge lengths are preserved.

Create a simple mesh as shown. With edges and verts emulating bones.

Here the mesh is moved 1 over for visual

Add a curve modifier to the mesh. I've made the mesh z up to cooncide with bones global orientation, so I track the mesh on curve using Z. The mesh can "run on the tracks" by animating its Z location property. Can switch tracks by changing this one modifier target

Next we add a copy location constraint of root bone to our mesh object, with base vertex group as a subtarget, and a track to constraint along the axis of bone "Y" to the next vertex group.

For all subsequent bones in chain add track to constraint to next vertex group.

• nice! It's true that the method I explained will force to correct the Offset every time we change the curve length – moonboots Feb 27 '19 at 12:38
• Both answers are good but this one seems pretty reliable. – Leo Blanchette Feb 28 '19 at 0:44

To make a snake-like animation you can do it the way I explain below (inspired by bugzilla2001 here: https://www.youtube.com/watch?v=VXheGvyEz3A& ).

But as batFINGER said it has a drawback because as it uses the Follow Path Offset, each change you'll make on the curve length will imply an adjustment of the Offset...

Anyway, here it is:

• Create your object (snake, train...)

• Create the armature, parent the object to the armature:

• Create an empty at the beginning of the armature, parent the armature to the empty:

• Create your road with a curve. Change its direction with a W > Switch Direction if necessary, put its origin at its beginning:

• Put your empty at the center of the scene with an altG:

• Give your empty a Follow Path constraint and choose the curve as the Target. The empty will stick to the beginning of the curve:

• Duplicate the empty with a shiftDenter, change the Follow Path Offset of this second empty so that it is separated from the first with a distance of approximately one bone::

• Create as many empties as you have bones, and again change the Offset of each one:

• In Pose mode, select the first bone and give it a Track To constraint, with its empty as Target:

• Do it for each bone. Then correct the Offset of each empty so that it sticks to its bone tail:

• If you play the animation the armature should follow and the whole object should bend along:

• To set the animation parameters and speed yourself, select the curve, go in the Graph Editor, select the Evaluation Time track, open the properties with N, press the Modifiers tab and remove the Generator:

• Now in the Properties panel > Data > Path Animation, you can keyframe the Evaluation Time yourself: