Animation : how can i get back to the state before an animation ?

Hello everyone !

I have a little problem : I created an animation (by unity) for my player when he dies. But when he respawns I want him to be as he was before this animation. An easy solution should be to reverse this animation and play it very very quickly to get back to the previous state, but I wonder if there is a cleaner way to do this.

It is for a multiplayer game, so I would like to avoid to destroy all my character and reinstantiate one…

Sure so either:

  • Disable the animation: animation[“YourAnimation”].enabled = false;
  • Reset it to the start: animation[“YourAnimation”].time = 0;
  • Set its weight to 0 : animation[“YourAnimation”].weight = 0;
  • Stop all animations : animation.Stop();

Or a combination