Animation not working with Mecanim

I’ve got a character rigged and animated, imported as FBX into unity.
Using mecanim, everything works fine, but one of the animations is broken. One of the bones in the hand isn’t rotating/moving at all for some reason. Every other animation seems fine and works the way I want them to.

The animation works perfectly in the preview box.
The animation works perfectly if I just remove the Animator and add an “Animation” instead (Legacy).

This is my setup:
Type: Generic
Avatar: Created from this model

Transitions don’t seem to be the problem either, I tried removing all transitions in the Animator and just using Animator.Play(“Attack1”, -1); and the animation plays without any transition, but the hand is still messed up.

It could be the avatar transform hierarchy, all animation curve are binded by transform path, if there is one transform name from the clip that doesn’t match the avatar definition hierachy the animation curve for this transform won’t animated anything.

Select your broken animation in the animation window, and find the transfrom that have an animation curve but doesn’t work, take a look at the transfrom path from the root to this transform and make sure that your GO skeleton transform hierarchy match perfectly the same name.

If both transform path doesn’t match then you have your answer.

If both transfrom path does match, please create a bug report with a project exposing the issue and send me your bug number once you get an email reply from the bug reporter.

I can’t use the animation window with the .anim files, it just says “No animatable object selected”. I tried selecting it from the .fbx aswell, same thing.
EDIT: Nevermind, tried adding the Prefab to the scene and now I can check the animation window.

you cannot select an animation clip directly to edit it in the animation window, you need to select a GO with an animator component setup with the controller containning your animation. This is a limitation since day 1 in Unity, in the next version 5.5 you can now select a clip directly to edit it.

1 Like

OK, I figured it out, partly thanks to you @Mecanim-Dev and some other people on the internet.
For people wondering what it was: One of the bones in the animation (Hand bone) didn’t rotate correctly. I had to find the transform in the Animation window, right click the little sideways thing next to the hand rotation and then under Interpolation, go from Quaternion to Euler Angles (Quaternion Approx.) and then back to Quaternion.

I still don’t know if this was something Maya left behind or if it’s something that went wrong inside the import in Unity or what, but now it seems to work.

This reset something and made everything work flawlessly in game. Thanks for the help @Mecanim-Dev !

hum … still this is weird.

If you still have the orignal project we would like to investigate this issue, changing back and forth should not change the behaviour of the animation.

if you can please log a bug with your project, send me your bug number and we will investigate

1 Like

I appreciate the fact that you take an active effort in sorting these kinds of things out. I’ve logged a bug and sent you the bug number via PM.