Cannot get train to follow curve without tilting

Hi. I’m trying to setup an animation of a train looping around a track. I would also like the track to have a short hill at one point.

I’ve looked around and tried a few different ways to accomplish this, however found there is usually a flaw with the result (e.g. the train cars stretch or the train cars don’t stay the right distance from each other).

The method I’ve found that is almost perfect is what I describe below. The problem however is when the train starts climbing or descending the hill it rotates sideways around the path.

train-tilt

Please let me know if you have a fix for this, or an alternate setup I should try.

Thanks!

Setup:

  • A mesh for the train with separated train cars
  • An armature with one bone per train car
  • A curve object (“train curve”) the same size and position as the armature’s bone chain
  • A Spline IK bone constraint added to the last bone in the bone chain with the “train curve” object as the target
  • A second curve object (“track curve”) as the path for the train to follow
  • A Curve modifier added to “train curve” with the “track curve” as the target curve object and the “Apply on Spine” option selected
  • Animate the “train curve” Y position to move along the track

train-curve

sdfsd

Check the normal of the curve

Unfortunately the problem doesn’t appear to be tilt related. All control points of the track curve have a tilt of zero.

Here’s my blend file https://easyupload.io/3cp3yv (Sorry for using a 3rd party site, as a new user I"m not able to upload here directly)

In the Curve Data properties panel, change the Twist method from Minimum to Z-up.

1 Like

dada.blend (1.1 MB)

It seems that the normal direction of the curve should be the same.

Interesting, so the hill part of the track curve needs to be parallel to the train curve’s axis. An unfortunate limitation but I think I can make it work with my scene.
Thank you Kim!

1 Like