Reviving player

If I set a save point with the player still alive and then he gets killed, if I load the game, the player goes to the correct position and has his health restored but he is still dead (laying on the ground and non-responsive). Is there an easy way to reset the animation to the original state so I can die but pick up where I left off?

I’ve googled how to reset an animation but nothing I’ve tried seems to work.

Sorry, I missed this the frist time around, lampcord.

The SavingWrapper.Load() is nice, but it does have the problem that it creates zombies and leaves perfectly healthy players lying on the ground in utter despair.

We could address the issues one at a time (in the case of the player lying dead on the floor, you could reset the animator), but before you know it, you’ll find a dozen (that I’ve identified so far) potential issues including item duplication bugs and more.

The real solution is to reload the scene when we load the game.

Leave the SavingWrapper.Load() alone, we need it in Portal and don’t want to change it’s behavior. The change you want to make is in SavingWrapper’s Update() method. Instead of calling Load() when the “L” key is pressed, replace it with this line
StartCoroutine(LoadLastScene());
This will physically reload the scene and then apply the effects of RestoreState(), and complete our character’s ressurection.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms