7
$\begingroup$

I have a cube that moves along a bezier curve (it's a mine cart). It is a simple animation, keyframe at start, keyframe at end, with a curve modifier on the cube.

I want to export the animation and load it into Unity to test some stuff out. However, when I do that, the animation exports, but there is no curve modifier - it just travels along a straight axis, instead of along the curve.

Anyway to fix this?

$\endgroup$
  • $\begingroup$ Are you sure you do not mean to do a Curve Path Animation ? A Curve Modifier is a deform modifier to change the shape.... I just tried a Curve Path Animation (set parent to -> Follow path) and it comes fine in Unity $\endgroup$ – oenvoyage Jan 28 '16 at 17:19
  • 1
    $\begingroup$ Have you tried baking the animation to the cube, then importing it? $\endgroup$ – Squirrel Jun 24 '17 at 3:02
1
$\begingroup$

Like oenvoyage (in the comments) I'm not sure a curve modifier is what you're talking about either. For a "simple" "mine cart" animation on a curve I would think you would use something like a "Follow Path" constraint.

If you are using an actual curve modifier my solution here will probably not work.

But if it's simple object animation created using a constraint like I theorized you might use, or parenting or any other similar methods of animating that is not just simple keyframe animation you can always bake the action to keyframes so it should always export no matter what the destination program's compatibility or incompatibility with constraints.

With the object selected go to "Object/Animation/Bake Action" Picture of the blender interface with Object/Animation/Bake Action selected

In the new menu you will probably at least want to select "Visual Keying" which will make it bake (AKA turn into regular keyframes) all animation, like constraints and parenting. If you have constraints or a parent animating the object you can check the options to "Clear constraints" and "Clear parents," or just remove the parenting/constraints yourself when you're done. You also want to make sure the frame range selected encompasses your entire animation length. The Blender bake action menu This will take most any animation or movement and convert it into keyframes on the location/rotation/scale of the base object, so it should be reasonably simple to export it to any other application like Unity. However, you will lose all the control and ability to adjust the animation that non-destructive constraints and parenting offer you.

$\endgroup$
0
$\begingroup$

Try the following:

1.) Add Constraint Follow Path

2.) Animate Constraint

3.) Press Alt + G to clear the Location (That could solve your Problem)

4.) Bake animation

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.