Humanoid Rig breaking animations that work fine as Generic

Update: We submitted this as a bug to Unity and they’ve confirmed it’s an issue with the Humanoid rig. It should be fixed in the next release.

You can see a demonstration of the issue at hand here: - YouTube

We make extensive use of re-targeting animations using the Humanoid rig system and this has worked great so far.
However we have run into inaccuracy problems when some of our animations are played in Unity, and one particularly game breaking issue with a hand spinning erratically.

Character animations come into Unity quite well but not perfect (The doco explains that this will be the case: Mecanim humanoids | Unity Blog)

Some animations completely freak out with the humanoid rig, most prominent in one of our attack animations with the locator the weapon is attached to flipping direction erratically. You can see this in the above Youtube video.

Switching to the Generic rig solves all the animation problems, but stops us from retargeting the animations or mirroring them which would mean an enormous amount of extra work for our animator.

Forcing the rig to reset in the humanoid config window reveals that some of the fingers do not line up correctly, but the fingers are not what are breaking in the animation:

Here are our import settings for the animations set to humanoid:

So our question is, can we resolve the hand flipping out? Is this a known issue and is there some way around it, or is there a different way we can set up a humanoid rig to avoid this issue? Thanks!

One thing I could think of is that your animations are animating the weapon attachment. This would explain why your animations work in generic but fail in humanoid because all of that data is lost. The data is lost during the transition from generic to humanoid and heres why:

When setting up a humanoid rig, the reason why you have to go through all the bone assignment steps is because unity is creating a humanoid rig from scratch based off your supplied rig information. By assigning values during setup, unity knows which bone is which.

this means, technically, unity is not using your rig when it is playing these animations in game. It is using the created rig.

Since rigs can come in many shapes and sizes with different attachments etc, unity creates a general rig so that the animations can be retargeted. Since the rig unity creates will be internally identical, it allows for animation retargeting.This means all of your attachment bones (weapon attach, helmet attach, etc) will not be brought along in the process.

Tell your animator when they are animating the weapon movements to use the hand/wrist for weapon rotation. This way you can create the weapon attachment inside of unity as an empty game object child of the hand. From there, attach weapons and youre good to go. As far as your external rig is concerned, attachment bones serve no purpose in unity other than a reference when creating the animation. The animation’s movement should not rely on these attachments

Also: I could not tell if you were assigning the weapon attachment bone to your humanoid rig. do not include the attachment bones when setting up the humanoid rig. Unity will think it is something it is not (a finger/hand/ etc) and you will get strange results

As for the small amount of clipping that occurs, this is again, because unity is creating a rig from scratch. You do have the ability to move/rotate bones while setting up the T-pose and with a bit of tweaking could fix these issues. This could also produce strange results with skinning/other animations. This step, if you choose to do it, requires the most hand tweaking/testing to get right

Hello, you can try do this:
check mask in your animation.

Still having same issue in 2018. Did unity actually fix the issue?

Here If you are using a character as a humanoid then when you have imported the animations make sure that you when you check them as humanoid please select avatar definition as copy from other avatar that is you’r original base character for that animation.
Means Don’t select create from this model select the copy of your character there.

If anyone still didn’t find it.
1)Go to your animations then select option create model from another avatar in inspector tab.
2)Now go to your 3d model(i got it from mixamo).If you convert your 3d model to humanoid then you can get an avatar.Then drag and drop it into all worked for me