Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Why when running the game the animation start in another position ?

Discussion in 'Animation' started by Chocolade, Apr 7, 2020.

  1. Chocolade

    Chocolade

    Joined:
    Jun 19, 2013
    Posts:
    916
    This is the position of the character before running the game :



    And this is when running the game and the animation start playing. The character is falling a bit down then the animation start. But I see that the position on Y is not changing. So maybe it's just the animation that play like that ? Or there is something I can change and set so the character will not fall a bit down before the animation start ?



    The only things I changed was checking setting to true both Loop Time and Loop Pose on the animation.
     
  2. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    Hi,

    I feel the pain...

    It's actually your animator which moves your character at runtime.

    I don't remember exactly what I did to fix that but I think if you assign an animation within the controller then it's gonna use the position specified in the animation.

    You could also get the world position before the Animator is applied and then after to get the delta and then offset your character by the negative of the delta to make sure your character stays at the same position in space.

    The things is that usually, you either set the root position in the script or the root is specified in the animation file (see apply root motion in the Animator component)
     
  3. muhamad1987

    muhamad1987

    Joined:
    Jul 17, 2017
    Posts:
    14
    if you play the game, the object continues to fall down?
    or just a minor glitch?