0
$\begingroup$

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".

$\endgroup$
1

1 Answer 1

1
$\begingroup$

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).
$\endgroup$
4
  • $\begingroup$ 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. $\endgroup$
    – Dazotaro
    Apr 5, 2019 at 21:17
  • $\begingroup$ 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. $\endgroup$
    – Dazotaro
    Apr 5, 2019 at 21:25
  • $\begingroup$ 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. $\endgroup$
    – Dazotaro
    Apr 5, 2019 at 21:40
  • $\begingroup$ 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. $\endgroup$
    – Dazotaro
    Apr 5, 2019 at 21:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .