- Home /
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: http://youtu.be/ujtT2v11Fxo
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: http://blogs.unity3d.com/2014/05/26/mecanim-humanoids/)
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: http://cardboardkeep.com/uploads/Humanoid_TPose.jpg
Here are our import settings for the animations set to humanoid: http://cardboardkeep.com/uploads/Humanoid_Settings.jpg
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!
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.
Answer by b1gry4n · Dec 06, 2014 at 11:57 AM
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
Hi b1gry4n, We tried what you suggested and I'm afraid the problem persists. We've also tried parenting the weapon to both the locator and directly to the hand to no avail. Last thing we're trying now is re-exporting the rig with no locators.
Re-exported rig with no locators and it didn't change anything. We also tried applying the animation to a Unity-made rig and model, as you can see the problem is still there: https://www.youtube.com/watch?v=SodLwWazgP8
Answer by jenanty · Jan 29, 2015 at 10:57 AM
Hello, you can try do this: http://i.gyazo.com/f5d3e52b6e64c22622ce43aa7315c112.png check mask in your animation.
Answer by grossim · Mar 18, 2018 at 04:02 PM
Still having same issue in 2018. Did unity actually fix the issue?
Same here, character gets an impossible leg twist on the last frame of the walking and running animation really tiresome T_T Should have used a more unity friendly animation tools, i guess..
After much struggling and frustration regarding this issue I found that changing the character's rig to not "Create from this" but rather "Select from existing" solved the issue.
Basically, I created the animations for the teenage boy and used his mesh when I exported it from $$anonymous$$ixamo. For some reason yet unknown, not all characters rigged on $$anonymous$$ixamo work with the same animations with the same bones etc. By setting all $$anonymous$$ixamo characters to using the same character rig that the animations were downloaded for, that worked just dandy.
No more did the mother have a single correct walk loop before walking on her toes on one leg while walking on the side of her horribly rotated foot on the other... now it just worked. So the problem now becomes picking the correct Rig/Avatar/whatever you call it when you select the character's animation mode. Hope this helps
I have encountered the issue of Unity introducing leg twist to animations recently and wanted to add to this as documentation. The reason that the leg twists on the last frame of walking and running animations when you use them with a humanoid rig in Unity is because the created humanoid rig does not give you control over the leg's IK handle's pole vector. Usually, the pole vector would deter$$anonymous$$e the rotation of the plane of an IK handle (each leg is rigged with an IK handle automatically by Unity). However, it seems that for the generic rig, this pole vector is always aligned with the character's forward vector. So when the IK handle fully extends, its bend isn't defining a plane for rotation anymore, so it falls back to the pole vector, which is facing forward, so the knee tries to snap to be at a 180 degree angle with the character.
Answer by khan4u · May 06, 2020 at 08:18 AM
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.
Answer by Sanjay112000 · Jan 20, 2021 at 11:08 AM
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 animations.it worked for me