Search Unity

Problem With Animation Position Resetting

Discussion in 'Animation' started by Wilelle, Jun 28, 2015.

  1. Wilelle

    Wilelle

    Joined:
    Jun 16, 2015
    Posts:
    93
    I know this question has been asked many times, but no answer satisfied me. I want my player to play an animation on death, but when it does it's sent back to the position where the animation was created. I know that this can be solved by parenting the player to an object, but I don't want to do that. Is there some way to work around it or will I have to use this method?
     
  2. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
    How did you create your animation?
     
  3. Wilelle

    Wilelle

    Joined:
    Jun 16, 2015
    Posts:
    93
    With the built-in animation window in Unity. It's just a placeholder and the final one will be made in Maya, but at the moment I need a way to make it work with this way.
     
  4. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
    You need to do two things:

    • Turn on 'Apply Root Motion' on your Animator component
    • Select the Animation asset you created, and click the 'Generate root motion curves' button in the Inspector.
     
    erfan-zixor and theANMATOR2b like this.
  5. Wilelle

    Wilelle

    Joined:
    Jun 16, 2015
    Posts:
    93
    This almost works, but the player returns to its original state while the animation is playing. I'm trying to make it fall backwards, but instead it kind of leans backwards and then straightens. Any idea why?
     
  6. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
    Hmm... did you click 'generate root motion curves' for your fall-backwards animation as well?
     
  7. Wilelle

    Wilelle

    Joined:
    Jun 16, 2015
    Posts:
    93
    I did. But I think I've found the problem. It seems to be caused by the First Person Controller script, which forces the player to stand straight. I had thought of that and therefore made sure it's deactivated when the animation plays, but for some reason it still happens. But that's a different matter, so I'll have to find a way to figure that out or make a new thread. Thanks for the help, though!
     
    superpig likes this.
  8. MathewHI

    MathewHI

    Joined:
    Mar 29, 2016
    Posts:
    501
    Where is the "generate root motion curves" option for Unity 2021? I'm having the same problem but can't find that anywhere.
     
  9. AnarShia

    AnarShia

    Joined:
    Aug 29, 2021
    Posts:
    2
    dude I found I guess disable apply avatar mask resim_2021-09-15_222054.png
     
  10. AnarShia

    AnarShia

    Joined:
    Aug 29, 2021
    Posts:
    2
    create new animation track and click on that track then disable that function