Search Unity

Humanoid passes through self during animation

Discussion in 'Animation' started by notforthebirds, Sep 22, 2017.

  1. notforthebirds

    notforthebirds

    Joined:
    Apr 30, 2015
    Posts:
    7
    I have applied an animation I captured to another gameobject, which is a Humanoid. The animation plays as expected except the humanoid passes through itself. For example, instead of the arm coming to rest against the leg, the arm passes right through the leg. I tried applying a rigid body and collider but nothing seems to resolve this. Does anyone have ideas for me to try? Thanks!
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Sounds like maybe the curves generated for the animation are linear curves.
    The animation has to be edited to curve or ik lock the hand into the leg if you want the hand to rest on the leg.
    No 3D rig in any game engine has surface colliders by default. So meshes and bones will pass through each other. This is not uncommon.
    Adjust the animation so it looks proper OR if you want a rig that supports self collision - that will have to be set up by you.
    But physics and animation kind of battle against each other for control when apllied to the same object so best to edit the animation to solve the non collision issue.
     
    notforthebirds likes this.
  3. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    Indeed this is a common problem when using animations from models on other models. If you are using Mecanim and the Humanoid rid(as opposed to just the general one), there are options to limit how far some of the bones can rotate, which is useful for when animations don't perfectly fit.

    As mentioned above, you may have to just do some adjustments on the animations directly. This of course takes time, so depending on how bad the animation looks, you may be better off just leaving it if it isn't that obvious once you are actually in the middle of gameplay.
     
    theANMATOR2b and notforthebirds like this.
  4. notforthebirds

    notforthebirds

    Joined:
    Apr 30, 2015
    Posts:
    7
    Thanks for the explanation! It helps a lot.
     
  5. notforthebirds

    notforthebirds

    Joined:
    Apr 30, 2015
    Posts:
    7
    Glad to know I am not alone! Thanks for taking the time to reply!!