Scale animation messed up in Unity (Help XP)

Hello everyone!

I have a problem with the FBX export in Unity from Blender in regards to a scale animation :confounded:.

As you can see in this gif below, the Tank threads are scaled from 1 to 0 to give the user the illusion that it is a moving thread. I like how this looks in Blender:
TankAnimation_Blender
The animation has keys on every frame because I baked the animation ^

But when I import it into Unity I get this horrible result below:
TankAnimation_Unity

Looking at the animation curves straight up from Unity, you can compare them to those in Blender and weird thing are going on. As if Unity couldn’t handle a linear animation curve and transformed it to a bézier or a clamped curve. See image below:

To rule out any possible questions you might have, I’m sending some more screenshots of general info you might need to know:

If all this info is not enough, I encourage you to download the blend file below and test the exporting yourself (I’m also including a sample texture or otherwise, the thread animation won’t make much sense).
I wrapped my head around this problem for a while but I have come to a halt and I need some help on this one because I have many (MANY) units that revolve around the same principle with threads and I want to share this with the community for free (anyway, the units do not belong to me, they are from Nintendo).

Also, if your a Godot user or UE user or any other Game Engine user, I encourage you to test it yourself and send me feedback on the export settings.

Almost forgot, currently using Blender 4.0.0

Thanks in advance and for reading my post.


TankSolo.blend (1.4 MB)

Tank blend file and texture ^

After doing some more tests on this issue, I think I found a solution but not a very easy one.
Here are some steps I did to be taken into account:

1.- B-bones (Blue Tank) were turned back to Octahedral type (Orange Tank).
I’m sure this change didn’t have any effect but still, I wanted to mention it.

2.- Deleted constrains in bones that had them:
In this image below (orange tank), you can appreciate all bones are the same blue color (as in no Constrains).
imagen
Whereas in the image below (blue tank), you can appreciate some bones do have Location Constrains.

3.- Because I deleted the Constrains I had to redo the bone parenting to emulate the original behavior.

4.- I redid the Thread bones animation (the conflicting part).

  • Created a completely new action.
  • Redid the Thread animation.
  • Pasted keys from previous animations to new action.

5.- I noticed that if on a Stepped or Constant animation, if keys are overlapping, Unity apparently has a hard time understanding whats going on but, if both keys are separated by one frame (so that both bones are visible at the same time for a single frame), apparently, the animation imports correctly (though some of the previous steps mentioned before, appear to be necessary as well).

Bad animation in unity recap (current assets):
TankSuccesfulAnimation_00

The fix I found in Unity as described above:
TankSuccesfulAnimation_01

If you find something else let me know.

Bendy bones don’t export.

You need to bake your animation (a keyframe on every frame) before exporting if you’re using anything other than default interpolation.

You don’t need to delete your constraints, you just need to bake your animation with the constraints

Thanks for looking at my inquiry :smiley:

  • That’s the weird thing, in my first export I baked every single frame and Unity went bonkers, that’s why this time around I didn’t and somehow it worked.
  • I also then thought constrains were messing it up, so I deleted them, baked every key again and it still didn’t worked.

My best guess is the animation got corrupted and the FBX couldn’t handle it. Only remaking it almost from scratch seemed to work.

Though thanks on the bendy bones tip, I suspected it didn’t mattered anyway and I can double check it now with your advice. Thanks.

It’s been a while since I posted this, but since many people have checked on this, I want to give a closure to this matter.

Apparently, if you’re running under the same problem as I do, the solution to this issue is to: Avoid completely importing assets with stepped animation inside Unity.

That’s it, I have no better solution than that one.

Demonstration:
In this gif below you can appreciate how in Blender, the cube teleports to different locations in a stepped animation fashion (and it behaves as it should):
CubAnimIssue_01

If I convert it to an FBX file and import it into Unity and play the animation, at first glance everything looks fine in the gif below but, on a closer and more precise inspection, you may appreciate that Unity is still interpolating the translation from one point to the next one. It just happens so fast it “looks like” it is stepped animation, but it really isn’t:
CubAnimIssue_02

If we check the animation file inside Unity, you can verify that the Curves are by no means stepped at all in the image below:

If you want to fathom even more on this issue, I’ve found other posts of other users who have struggled with the same issue as I have, but apparently Unity can’t do stepped animation because of frame rate and stuff.

- Explanation of Unity not handling stepped animation

- Can’t edit imported animation:
https://www.reddit.com/r/Unity3D/comments/1cykl87/how_do_i_change_the_interpolation_of_an_animation/

- Attempt to disable animation curve interpolation in Unity:

Do remember this post was about setting stepped animation in Unity on an imported asset, not an asset animated inside Unity.

If someone else finds a real solution to this in the future, feel happy to drop by.