Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question How to control hips/upper leg in avatar mask

Discussion in 'Animation' started by bbjones, Feb 14, 2024.

  1. bbjones


    Feb 1, 2016
    I have a humanoid rig where I'm trying to mask off the upper body but I want the mask to include the hips/upper leg. This is for directional attack animations where they need to include some hip twist and leave the legs out of the mask so they can keep walking etc.

    My understanding is the built-in avatar mask has no options to include/exclude the hips/upper leg and the only way to have control over individual bones/transforms is to change everything over to generic rig, which is a huge amount of work (all my rigs/animations etc).

    Is there a way to control what bones are masked at runtime in code? Is there any API I can access?

    To clarify:
    - base layer runs locomotion animations run/walk etc
    - upper body layer runs the upper body attack animations and I don't want the legs affected, but I do want the hips affected which can't be set in the standard humanoid avatar mask
  2. dobriniarechkin


    Feb 19, 2018
    Animator SetBoneLocalRotation(HumanBodyBones Bone , Target) - work only OnAnimator IK , for hips our legs must have IK for its pose , good if has hints knee

    there's more
    Animator.bodyPosition and Animator.bodyRotation - but center mass , I think it's better to use only little fix something in work animation pose