0

I want an object to follow a path in space (specified via F-Curves, or by clamping to a Bezier curve), but I want the Z axis of this object to always be tangent to this trajectory (the same way that the engine of a train is approximately tangent to the train tracks).

I've tried using constraints: having an empty move along the "train tracks", and my object following closely behind, using a track-to constraint (so the object's Z points to the empty). I've paired this with a limit distance constraint (target is again the empty), but the result is not visually convincing -- it looks like the object is short-cutting the turns, as opposed to staying on the "train tracks".

Dazotaro
  • 901
  • 1
  • 9
  • 20

1 Answers1

1

If the goal is for an object to move along a curve (e.g. Bezier) with one of its axis aligned with the curve's first derivative, as suggested by @atomicbezierslinger, you can use a follow path constraint. For example, if we want the object's Z axis to be aligned with the curve's tangent:

  1. Set Follow Curve to true.
  2. Set the Forward axis to Z
  3. Set the Up axis to either X or Y (setting to Z will not work, and the object might not move at all).
Dazotaro
  • 901
  • 1
  • 9
  • 20
atomicbezierslinger
  • 14,279
  • 28
  • 42
  • The Follow Path constraint works if I select as Forward the X or Y axis, but not the Z axis (which is the one I want). When I select as Forward the Z axis, nothing happens -- the object is static at its location, not moving during the whole animation. – Dazotaro Apr 05 '19 at 21:17
  • I see a dotted blue straight line from the center of the object to a point traveling along the Bezier curve, but the object itself remains static. – Dazotaro Apr 05 '19 at 21:25
  • I got it to work by rotating the object and using the -Y axis, but I still don't know why the Forward = Z does not work. – Dazotaro Apr 05 '19 at 21:40
  • The problem was that both the Forward and the Up axes were set to Z. If Forward is set to Z, then up needs to be set to either X or Y. – Dazotaro Apr 05 '19 at 21:53