Search Unity

Avatar Masks Freeze Body

Discussion in 'Animation' started by RoyalSkiesLLC, Nov 30, 2021.

  1. RoyalSkiesLLC

    RoyalSkiesLLC

    Joined:
    Aug 27, 2016
    Posts:
    16
    Hi there! I was wondering if anyone had any idea as to what might be the reason for an upper-body avatar mask to freeze the whole body when it's activated. I have a walking tree, and an upper body aiming tree. But when I run the game, I can't seem to aim while walking. And, when I turn the upper body mask on, it seems to freeze the whole body, so my walking animations no longer play.

    I feel like I'm just forgetting to check a box or something, but I have a video that can clearly demonstrate the problem here:


    There is only 1 script to control the animation variables, and it looks like this:
    Code (CSharp):
    1. public class AnimationControlTest : MonoBehaviour
    2. {
    3.     public Animator myAnimator;
    4.     public float rotValue;
    5.     public float leftValue;
    6.     void Update()
    7.     {
    8.         myAnimator.SetFloat("x", Input.GetAxisRaw("Horizontal"));
    9.         myAnimator.SetFloat("y", Input.GetAxisRaw("Vertical"));
    10.         myAnimator.SetFloat("aimX", rotValue);
    11.         myAnimator.SetFloat("LaimX", leftValue);
    12.  
    13.         //Tests change in torsoTwist Value with 'J' and 'L'
    14.         if (Input.GetKey(KeyCode.J)) rotValue = Mathf.MoveTowards(rotValue, -1, .05f);
    15.         else if (Input.GetKey(KeyCode.L)) rotValue = Mathf.MoveTowards(rotValue, 1, .05f);
    16.         else rotValue = Mathf.Lerp(rotValue, 0, .05f);
    17.         //Tests change in leftArm Value with 'I' and 'K'
    18.         if (Input.GetKey(KeyCode.I)) leftValue = Mathf.MoveTowards(leftValue, -1, .05f);
    19.         else if (Input.GetKey(KeyCode.K)) leftValue = Mathf.MoveTowards(leftValue, 1, .05f);
    20.         else leftValue = Mathf.Lerp(leftValue, 0, .05f);
    21.     }
    22. }
    If it helps, I do have the Unity file (very small) which you can troubleshoot if that helps too here:
    https://drive.google.com/file/d/1Vdc9t1nsfRoFhMDsOnrIoBBfmPkCScqH/view?usp=sharing

    Again, thank you very much for your time :)
     
  2. Grhyll

    Grhyll

    Joined:
    Oct 15, 2012
    Posts:
    119
    Just a random thought: did you try unchecking the WriteDefault on the TwistTorso state?
     
  3. RoyalSkiesLLC

    RoyalSkiesLLC

    Joined:
    Aug 27, 2016
    Posts:
    16
    I haven't, let me give it a shot -
    [EDIT] Just tried it, and still seem to have the same problem :( Is writ default only supposed to be checked on the base layer? I went ahead and turned of WriteDefault on both the other layers-
     
  4. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    I think I run into this issue when I was testing how to animate a tail. Can't remember the solution.
    Can you check the humanoid part of the mask if they are red? I seem to recall they work on kind of its own, and if you don't enable them they won't get animated.
    There were some limitation on the transform mask when using humanoid retargeting, I think you cannot use a mask on the transform simply like that when using humanoid. Try experimenting with the humanoid mask. Sorry It has been 2-3 years since when I tested it, so just some random thoughts.
    Also try to use an additive layer, not an override one.
    With an override if it is like I remember, the humanoid if not correctly setup may try to overwrite the lower port of the body.
     
    RoyalSkiesLLC likes this.
  5. FeelsLikeGameDev

    FeelsLikeGameDev

    Joined:
    May 29, 2018
    Posts:
    1
    I have the exact same issue and I can't find how to fix it. Can anyone help me please?

    It turned out I had to uncheck the box that said "Can Transition To Self" in my transition in animator. Maybe it helps someone.
     
    Last edited: Feb 18, 2023