I’m trying to make a train follow a path. So I constrained a mock-up to an armature, which I constrained to some empties that follow a path. Everything works beautifully, except that sometimes my rig makes fast unexpected jerky rotations along the path.
This is driving me absolutely insane. I have no idea how to fix it. I have to use an armature because I’m making an articulated train with soft folds separating the cars.
No! Bad armature!
I’ve attached my blend file.
MisbehavingAnim.blend (257 KB)
The empties are following the path. The armature bones are constrained to the empties.
Not sure why your train flips on its side, might have something to do with the normals on a nurbs curve (usually bézier curves tend to behave better and you can control tilt). In your setup you’re not explicitly controlling the longitudinal rotation of the wagons (where the “up” axis points to) because the damped track constraint does not allow you to do that - better use “track to.”
No need to use empties when you can constrain bones though. I tried to replicate your setup, try changing the tilt on the curve’s points and use the controller to move the wagons around.
The empties in my images aren’t affected by the normals of the curve at all. My armature is following the empties, not the curve.
I tried to check out your example, but the the timeline isn’t having any effect. I am also curious how you got the nose of the train to point towards the track.
Can someone else help out? Is there a way to force the bones to be constrained on one axis? I’m not able to get good results.
What is your modifier and constraint setup (if you have them)?
It might be a small user error, but we don’t know with the information we have.
Alternative, maybe just copy Hadriscus’ file as closely as you can, and then adapt from there.
You can see my set up in my blend file.
I’m not sure how Hadriscus’ file is actually animating. This is due to ignorance on my part. Also I don’t see how the nose of his train will follow the track since it isn’t pointing towards the track. Maybe he got it working. I can’t get the animation to play so I don’t know.
Alright so I fixed it, kinda.
I did as Hadriscus suggested and used track to instead of damped track. The problem was that using track to didn’t allow me to change the orientation of the armature, the armature deformed sideways away from the track center.
If I attempted to change the up direction, the constraint became red and turned off. I solved the problem by rotating the actual mesh geometry around to match the desired position.
I’m still using empties since I don’t understand how to get the nose of the train to follow the track any other way.
The resulting animation looks flawless. I still don’t consider my problem solved however, since I had to use a very “hacky” method to get the animation to work. This solution might introduce further problems down the line.
If someone has an actual solution, I would love to hear it.
I checked your blend file and I can’t see a huge difference between my scene. I used track to as well but my armature makes a 90 degree turn sideways. Otherwise it looks like your scene.
So have you tried my blend file with a 90 degree turn in the track, I have on my “Toy Steam Train WIP” and it works fine with two 90 degree bends and several smaller ones.
PS I will look at your blend file today.
Normalise your bones so the bones’ Z axis points in Positive Z global axis, (don’t just rotate the armature) I think this is why your armature flips - the Z axis of the bone should follow global Z then you can use Z as the Up axis on the constraints - these constraints cannot have X as the deformation axis and as the Up axis.
Use Track To constraints not Damped Track. I in fact use Curve constraints to fix the Icospheres to the track in my project, then fixed the armature to these.
Use Objects not empties as the Follow Path objects, they will then rotate correctly on the curve and align the bones properly.
Use “Fixed Postion” checkbox and animate offset from one end of the track.
Take a much closer look at the file I posted in the thread I told you about, look at all the hidden layers - it is seriously different to yours and it works…
Move the central bone it controls the train
That didn’t help.
You all have been a great help and I have checked your blend files. I solved the issue my rotating the mesh. It works for me since it is much easier to work with nurbs if you make a train follow a track while being upright at all times. I think this problem is solved and hopefully some lone googler will find value in this thread.
Ah, compassion for the lone googlers, right I almost forgot : To you, returning to this forgotten place from a distant time, we give our warmest salute. May you find salvation in our long dormant echoes and return to your work with an appeased heart.