Search Unity

Question Animation moves Character Y Axis

Discussion in 'Scripting' started by Nataneto_, Jan 28, 2023.

  1. Nataneto_

    Nataneto_

    Joined:
    May 28, 2022
    Posts:
    3
    I'm studying Unity and creating some prototypes for study.

    I came across a question that I couldn't solve, I'm using a Rigidbody code to move my character (3D), and everything works normally.

    However, my character has the animations to move,
    animations that move the character's "Y" axis a little, making him make small jumps while walking. The animation is pretty cool, however this movement on the y axis, is causing the character to not be "IsGrounded" when he walks, as it is as if he were leaving the ground and does not detect the collision.
    If you can help me I would be very grateful
     
  2. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    You can disable root motion on the animator so that it doesn't try to move the object at all.
    upload_2023-1-28_16-37-29.png

    Alternatively, if you need root motion, but just don't want it on the Y-axis, you'll want to check the "Bake into pose" options when inspecting the animation.

    upload_2023-1-28_16-36-35.png

    This will prevent any root motion from occurring. The movement will still be visible, but it won't do anything to the transform the animator is attached to.
     
  3. Nataneto_

    Nataneto_

    Joined:
    May 28, 2022
    Posts:
    3
    Even with Root Motion disabled and removing the Baked Position, it still modifies the Y axis :(
     
    domenicoleo4884 likes this.