Search Unity

Bug Animation Rigging Messes Up Humanoid Animations

Discussion in 'Animation Rigging' started by Grant151, Feb 8, 2021.

  1. Grant151

    Grant151

    Joined:
    Sep 12, 2013
    Posts:
    65
    When using animation rigging on my humanoid character (multi-aim constrain to look at the target), I have a few problems:
    1. The character slightly bends knees.
    2. Some running/rolling animations get messed up. In particular, the running animation starts wiggling hips too much, while rolling animations significantly sinks the character under the ground. The more rigs I add, the more severe these effects.

    This problem has been following me for months, today I updated to Unity 2020.2.3 and Animation Rigging 1.0.3 but nothing changed. Any suggestions?
     
    Last edited: Feb 10, 2021
    adamvfc likes this.
  2. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    323
    If you set weight to zero does it go away?
    I found that setting one rig per state seems to work. Only one rig/state is enabled at a time
     
    anycolourulike likes this.
  3. Grant151

    Grant151

    Joined:
    Sep 12, 2013
    Posts:
    65
    Setting the weight to zero (either/both on the rig and multi-aim constraint) does not solve the issue. Only deleting/disabling the whole animation rig helps.
     
  4. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    323
    With weight=0 I think it should not be effected at all. so somethings weird there.

    Does the game object get disabled/re-enabled. that will cause jumbling as described here:

    https://forum.unity.com/threads/mul...fter-deactivate-activate-from-a-pool.1024954/

    in which the user said they fixed it with:

    Code (CSharp):
    1. Animator.WriteDefaultValues()

    I do wonder if instantiating this character would produce the bug as well, as opposed to pre-existing on the hierarchy.
     
  5. Grant151

    Grant151

    Joined:
    Sep 12, 2013
    Posts:
    65
    Thank you for the help. Nope, my character is always enabled and WriteDefaultValues() does not help. Also, my character is too complex to be instantiated in play-time, so I can't test that theory.
     
  6. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    323
    sorry I have no suggestion then, perhaps unity staff will see your post, it sounds like a bug.

    If you have a rig set to zero weight, pretty sure you should not be seeing any effect at all...that is, unless your character got all wacked-out from whatever problem disable/enable causes, which is why i thought it sounded similar
     
  7. Grant151

    Grant151

    Joined:
    Sep 12, 2013
    Posts:
    65
    Any help here? Seems like this is the most obvious and basic use of animation rigging and its bugged...
     
    dogauslu likes this.
  8. Starcke

    Starcke

    Joined:
    Feb 22, 2019
    Posts:
    5
    It seems to be a problem with humanoid rigs and animation rigging, possibly how and when in the frame it calculates the positions and rotations of everything. At least, that was what my problem was, and I had to buy a plugin from asset store called Animation Converter from Soxware Interactive, it's cheap and simple to use.

    You duplicate your character/fbx of your model and make it a generic rig. Then you put your humanoid character as source rig, your generic as output rig, and all your humanoid animations you use into the plugin. Then just set it to generic output and it should work.

    It's a little hassle but it is a workaround for now.
    You can also find a youtube video on how to convert
     
  9. altepTest

    altepTest

    Joined:
    Jul 5, 2012
    Posts:
    1,118
    Check to see if you have any object that have the same name as one of your rig bones. Under your character top most body where you have created the rig. It can be a second bone rig with same names or maybe any other object that have same name as one or more bones you want to affect using the animation rigging.

    The way animation rigging works is by searching blindly all objects under the character top most object parent and once it finds duplicates it gets messed up in weird ways.

    I've tried to ask about this in my own thread but unfortunately got ignored.
     
  10. Grant151

    Grant151

    Joined:
    Sep 12, 2013
    Posts:
    65
    Thanks for the suggestion! However, I would really try to stay away from this unless NOTHING else helps.. I have hundreds of animations would not want to mess with switching types, etc; especially since this issue seems to be a very simple / common way of using animation rigging so it should be fixable
     
  11. Grant151

    Grant151

    Joined:
    Sep 12, 2013
    Posts:
    65
    Thanks for the insight! So does animation rigging just scan bone names? I just checked, I have no repeating names/duplicates, but at least this was the first interesting suggestion here :(
     
  12. Grant151

    Grant151

    Joined:
    Sep 12, 2013
    Posts:
    65
    Any help? :(
     
  13. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    323
    ok so how about this thought...

    I have been wondering why you have this problem and I have never seen it at all with my humanoid using all sorts of rigs and constraints, but then I remembered...

    My humanoid has an animation layer with avatar mask on it which is ignoring the legs completely. This way I can run around while the upper body is changed by animations/rigs/whatever.

    If you indeed have found a real bug you have to isolate it and report it for anything to happen, but perhaps what I'm coincidently doing is a workaround for you. I'm using the rigging package on the upper body quite a bit without any effect on my legs.

    edit: my characters with pre-rig that have been working are from mixamo, where are yours from?

     
    Last edited: Mar 5, 2021
    Grant151 likes this.
  14. Grant151

    Grant151

    Joined:
    Sep 12, 2013
    Posts:
    65
    I have 11 animation layers with different masks set-up for different purposes, but I don't see how this has anything to do with animation rigging. Animation rigging does not care about animator layers and masks because it directly overrides the bones that you set-up with constraints.
    I am using characters avatars from Synty, but that shouldn't matter since its a humanoid rig just like Mixamo...

    I am following multiple threads (link1, link2, link3) with similar issues and none of them have been resolved, which makes me believe its indeed a Unity bug
     
  15. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    323
    I would say you are right, animation rigging likely overrides the layer theory I had.


    How do I re-create the problem?

    I just downloaded unity 3rd person character from standard assets.
    Added a multi aim constraint with the animation rigging package

    Constrained object = head
    source object = cube (on main root of hierarchy)
    press play

    everything works correct. heads moves when cube moves, there is nothing changed with the knees at all. If I get a chance ill try the characters you are using. I only say that as a possible variable because when bones are set a certain way or rotation things get all weird.

    Unity 2020.2.3 and Animation Rigging 1.0.3


    EDIT:
    yep, I just tried a synty guy and the knees are bent when adding a rig only and doing nothing with it. This does not happen with standard assets guy or mixamo characters. must have to do with the rigging...not to say it isnt a bug, I suppose it is actually. Ill keep poking around with it, im not too experienced w rigging.

    https://assetstore.unity.com/packag...y-medieval-priest-st-patrick-free-pack-164796
     
    Last edited: Mar 6, 2021
  16. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    323
    I did a little digging, I rearranged the hierarchy of the synthy guy to match the first few children of the standard assets guy. then assigned the standard assets controller to the synthy guy. then added a multi aim rig and synthy guy is normal now without bent knees. He is doing the idol animation properly and head is following the multi aim constraint.

    edit again:

    actually the hierarchy doesn't need rearranging. The synty guy does bend kness if you add a rig, but if you have a controller set in the animator, then everything is back to normal.

    synty guy using synty controller with animation and multi aim constraint on head, everything is looking normal. (unless there is no animator controller set)
     
    Last edited: Mar 6, 2021
  17. Grant151

    Grant151

    Joined:
    Sep 12, 2013
    Posts:
    65
    Thanks for looking into this, but I am afraid you witnessed something different. When there is no controller in the animator the character is in its binding pose since no animations are playing. Are you sure that you saw the actual knees bending bug, and not just the empty binding pose (screenshot link)?
     
  18. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    323
    yes you are exactly right, its just the binding pose I saw as bent knees, the third person asset character had a controller set by default, where the synty guy did not, which through me off.

    So when I use either of these characters and put an animation rig on them, I'm not seeing any issue. It all seems to work for me with animations and rigs. I'm still confused how yours, and the other posters with the problem is different than mine...other than the fact that it sounds like your character is very complex
     
  19. Valvados

    Valvados

    Joined:
    Jan 27, 2013
    Posts:
    63
    Ethan from 2013 Stealth game has the same issue without a new rig. Darn his animations aren't bad either maybe if I grab a newer version of Ethan. Good to know it's just the character was planning on remodeling him anyways so I can just abandon him completely now.

    Tricky stuff I was looking at avoiding rigging entirely for my game but it looks like with this thread I can pursue that avenue again.

    Which is great because there are not a lot third person Unity action games that hold a pose on a human while a button is press that I have found. There's so many third person shooters as well it makes harder to find relevant information for third person not shooter, not free look based.
     
  20. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    323
    Well I don't know that is is just the character, I would like to see someone with the issue also try newer Ethan and see if results are same as mine...my results being that I have no issue with ethan or the synty priest guy... if that is confirmed by you all, then yes its just the character bone layout.

    My character is based off of Ethan here:
    https://assetstore.unity.com/packages/essentials/asset-packs/standard-assets-for-unity-2018-4-32351

    package is slightly outdated, you will have an error right away and must change GUItext to Text, import unity.ui in only one class just takes a second. then everything works.

    yes this is exactly what I am working on right now...I would say its still more complicated than I thought juggling all the animations, layers, rigs, weights and and weights of components in the rigs, and the Animation rigging itself still has some wackiness but it is working for me overall
     
  21. adamgryu

    adamgryu

    Joined:
    Mar 1, 2014
    Posts:
    188
    Just wanted to report that I seem to be having the same issue.
    Using the RigBuilder on my model causes animations to be messed up (exaggerated movements) even when the weight is set to zero. Disabling the RigBuilder returns the animations to zero.
    This doesn't happen on a simple model I downloaded from the Asset Store, but it does occur on my own model.
    I can't figure out what about my model is breaking the animations. I thought it could be a bone scaling issue, but everything is (1,1,1).

    Does anyone have any ideas of what actually causes this issue?
     
  22. adamgryu

    adamgryu

    Joined:
    Mar 1, 2014
    Posts:
    188
    Here's a GIF to demonstrate how the animation is corrupted. Even when the rig layer is disabled, the animation is still exaggerated (notice the arms wailing above their head). I have to disable the whole RigBuilder component to un-corrupt the animation. badrig2.gif

    Any workarounds for the time being would be apperciated.

    EDIT: I'm on Unity 2020.2.2f
     
    Last edited: Mar 21, 2021
    gorapiotr likes this.
  23. adamgryu

    adamgryu

    Joined:
    Mar 1, 2014
    Posts:
    188
    So, it took an embarrassing amount of time to come to this conclusion, but the bug is caused by incomplete / invalid Avatar configurations in Unity, for me anyway.

    I noticed that one of my models had this problem, while the other didn't, even though they shared the same bone structure and skeleton. A long time later, I discovered that the bone avatar auto-configuration was being done differently for each model. The model with the error didn't have shoulders set, nor the upper chest / neck. All these bones are optional in the avatar definition, so no error was thrown, and I don't know why auto-configuration missed them in one model versus the other.

    I suspect this is still a bug in the Animation Rigging package, since it still seems strange that the animation is being altered even when the weight is zero. If this is unavoidable, a warning might help people detect this avatar issue.

    Hope this helps others out there!
     
    Last edited: Mar 23, 2021
  24. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
    Last edited: Mar 24, 2021
    adamgryu and tree_arb like this.
  25. Grant151

    Grant151

    Joined:
    Sep 12, 2013
    Posts:
    65
    Glad that helped you, seems like you have the first working fix ahaha. In my case avatar is perfectly configured, so my problem lies somewhere else...
     
  26. owthathurts

    owthathurts

    Joined:
    Mar 8, 2019
    Posts:
    2


    I had a humanoid animation doing something similar - but it was not with all the instances of it.

    I had 5 of the same (prefab) humanoid with the same animation set in my scene - but found that for some reason on one of the characters, the animation was messing up every time it played - all the other instances of the character were fine. I finally figured out that the Rig Builder constraints were turned off on that one character -> i have the constraints get turned on/off at runtime as needed during the animation - but this character's were turned permanently off in inspector (before the game is running) for this one character only. I absolutely didn't change this setting - and have no idea what caused it. Maybe stoping the game-mid animation saved the current state of the animation rigging?? Or maybe there is a shortcut-key that I hit accidentally to deactivate them?
     
    Last edited: Jan 24, 2022
  27. Benjaminbinuyo

    Benjaminbinuyo

    Joined:
    Sep 26, 2021
    Posts:
    1
    Pls I'm having the same problem but mine is from the two bone IK constraints, its overriding all animations.
     
    MandSFun likes this.
  28. gorkemkaleli

    gorkemkaleli

    Joined:
    May 6, 2021
    Posts:
    2
    If I get it correct I fixed this issue with a small change. I delete the animation and reupload it to unity. Then I changed the Avatar Definition in Rig to Copy From Other Avatar and drag my own character there manually.
     
  29. gorapiotr

    gorapiotr

    Joined:
    Mar 30, 2020
    Posts:
    1

    Yes Thank you I had the same problem with the head and it tourn out I was missing reverence to neck in head and even eferything was green
    withoud this post I would not solve it , spend hours to try figure it out. again thank you.
     
  30. MandSFun

    MandSFun

    Joined:
    Mar 15, 2023
    Posts:
    3
    Yes it seems like its overriding my other animations(idle, walking running etc). i am using unity third party asset and added my own anim rigging for picking up of object but it seems like the particular arm i added rigging on affects my other anim states. :(
    Anyone knows the reason for this?