Search Unity

Accessing fingers in Mecanim

Discussion in 'Animation' started by BernieRoehl, Nov 25, 2013.

  1. BernieRoehl

    BernieRoehl

    Joined:
    Jun 24, 2010
    Posts:
    80
    I'm trying to close the hand of an avatar. Sounds simple enough, but I can't seem to find any way to do it.

    At first I was pleased to see that there was a muscle group for finger Open/Close. However, I can't find any way to access it at runtime. The only documentation I've found says to create a muscle clip, but no information about how to do that.

    I thought I could access the joints directly in LateUpdate() using animator.GetBoneTransform(), but HumanBodyBones doesn't have values for the finger joints.

    I'm using a variety of avatars from different sources, so I'd rather not resort to walking the hierarchy myself and figuring out which joints are which (especially when Mecanim has already done this work).

    Anyone have any suggestions?
     
  2. samuelmorais

    samuelmorais

    Joined:
    Aug 3, 2012
    Posts:
    62
    Hello,

    I have never done that and can't test it right now, but I think that you could create an animation of the fingers closing in a 3D application, export it as FBX and Play it on another layer that affects only the hands using a body mask.
    In this video there is a tutorial that might help.
     
  3. BernieRoehl

    BernieRoehl

    Joined:
    Jun 24, 2010
    Posts:
    80
    That might be an option (and thanks for the suggestion!).

    However, I also plan to have the hands grasp irregularly-shaped objects in the future so being able to access the fingers would be very useful.