Search Unity

Exclude bones from Mechanim

Discussion in 'Editor & General Support' started by Johannahe, Feb 18, 2015.

  1. Johannahe

    Johannahe

    Joined:
    Jan 31, 2015
    Posts:
    13
    Hello!

    I am trying to exclude some bones from Mechanim animations because the hands of my model are bound to a cross that he is carrying around.

    I have created an Avatar Mask in order to exclude the bones, but I am not sure onto which component I should drag this Avatar Mask.

    Also, I would like to point out that the masking of bones for animation could really be done easier in Unity!
     
  2. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
    The main way to use an Avatar Mask is to assign it to a layer in the Animator window.

    Note, though, that if your hands are children of the arms, and you're animating the arms, then they'll still cause the hands to move in space. If you need the hands to be in an actual fixed position, you either need to animate them like that, or perhaps look into using IK to hold them in place through code.
     
    BrandyStarbrite likes this.
  3. Johannahe

    Johannahe

    Joined:
    Jan 31, 2015
    Posts:
    13
    Hmm... didn't I do it correctly here?

     
  4. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
    Ah, if you've set the mask up there then that's OK, but it's only going to be applied to that animation. (If you wanted it for everything the character does, it'd be tedious to set this up for each animation, so creating a separate mask asset and plugging it into the Animator would be easier).
     
  5. Johannahe

    Johannahe

    Joined:
    Jan 31, 2015
    Posts:
    13
    Can you tell me how to apply my Mask to the Animator? I tried to drag it onto my Animator Controller, but it would not accept it.
     
  6. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
  7. Johannahe

    Johannahe

    Joined:
    Jan 31, 2015
    Posts:
    13
    Thank you!