Weird issue with Blender animation running riot in Unity

Hi guys,

I have imported a Blender created model with animations into Unity, and it is working fine except for one thing that seems completely screwed up.

Here you can see what the animation looks like in Blender:
blender_20130204.avi
Please note how both hands of the robot character are remaining relatively static (as intended).

And here is what comes out from it in Unity (in slow motion):
unity_20130204.avi
Note how the hands/arms are flapping around like crazy!

I’ve imported the model as a “humanoid” rig in Unity, and the bone mappings are looking absolutely fine from my point of view. I can also run all the muscle movements, they all seem to behave normally.

Only when playing the animation (either in the preview window, or in game mode), the hands are flapping.

Before going more into details: Has anyone every experienced this?

I guess there can be various reasons for it, e.g. from badly designed bones, weights, normals in Blender to wrong import settings in Unity. I’ve checked myself tons of things for hours, but haven’t come to any conclusion.

Any help higly appreciated!

One thing I noticed in your Blender video is that you have the NLA editor open in the bottom left portion of the screen. In my experience, animations seemed to always get “tangled” up with each other doing that. The best way I create separate animations to work with Unity is using a workflow that I found on blendercookie (see link below). I use 2.64, but I am sure not much has changed. It just uses actions in the dope sheet editor. I think it is easier to manage.

Blender Cookie - Exporting Characters from Blender to Unity

Hopefully that should help.

Meanwhile I found out that the bone rolls in my model are partially inconsistent: I did a test by automatically recalculating them (in Blender) and reimporting my model. As a result, my character looks weirdly twisted (as expected), but the animation issues are mostly gone (approximately 80% of the flapping effects have vanished).

Hence, though it’s still not completely solved, I strongly suspect my own corrupted Blender model being the reason for my problem. I assume that I have simply forgotten to recalculate my bone rolls in Blender prior to creating my animations. And now there’s probably no easy way to revert to a proper state (other than recreating all my animations from scratch) :frowning:

So the answer to my own question is: Take extreme care to properly clean up bone rolls in Blender before animating!

It seems that this is a potential reason for screwed up animation behaviour in Mecanim (i.e. it’s most likely not a Mecanim problem, at least in my situation).

How to recalculate bone roll in blender?:

  • switch to Object view,
  • select your armature
  • switch to Edit view
  • press “a” to select all
  • press space to bring up the context menu
  • type in “roll” to find the “Recalcutate bone roll” option

Hope this helps!