Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Character moving up with animation even with "Bake into pose" checked for Root Transform Position Y

Discussion in 'Animation' started by ZeHgS, Apr 24, 2022.

  1. ZeHgS

    ZeHgS

    Joined:
    Jun 20, 2015
    Posts:
    117
    DESCRIPTION OF THE PROBLEM

    I have a character with a throwing animation that has a Rigidbody with "Use gravity" checked. At the moment of the throw, in the middle of the animation, the character moves up a from the ground.

    OBSERVATIONS ABOUT THE PROBLEM

    This upward movement does not seem to be present in the animation itself when viewed in Unity's animation inspector, nor is it present in Mixamo, which is where I got it from.

    The character never comes down if I DO NOT check the option below and keeps climbing up each time the animation is played.



    If I DO check it, then the character STILL goes up but immediately comes down once the animation is finished.

    If I check "Freeze position (Y)" as below:



    The problem stops but other animations such as death animations stop working as the character floats after dying.

    I don't think it's the collider because the character stays well up off the ground after the animation ends and keeps going up more and more each time, staying far away from the ground.

    The problem persists with "Apply root motion" unchecked in the Animator.

    WHAT I HAVE TRIED

    Disabling all scripts, removing the animation event that was present and fiddling with all of the settings that I mentioned here, to no avail.

    QUESTIONS

    1) Why could this be happening? How could I find the source of this movement given that I don't see it in Unity's animation inspector/Mixamo?

    2) Is there a better fix than creating a StateMachineBehaviour script with OnStateEnter and turning on the Y constraint there and turning it off in OnStateExit?
     
    Last edited: Apr 24, 2022