I have a question that has been stuck with me for a while now, curious to know what you would consider is more efficient/reliable, even if it may be more work to set up at first.
Lets say, you have a game like Unreal Tournament or something, basically any game where re-spawning during a match is part of the game (be it in a botmatch or online match), and the player dies, how do you handle the player’s death, and “respawning” them?
Do you:
a) Destroy the Actor, then spawn a new actor from class at a set player start, get player health, armor etc from somewhere and apply them to the character;
or
B) Set visibility of character to invisible, disable collision, reset player actor health, armor, inventory (like picked up weapons) etc, move the actor back to a player start location, re-enable collision and make the actor visible again.
This is a part of your design. It depends on your needs and consideration of whether other elements will affect the decision or not. Your proposed solutions are not close to 80% of the goal yet. You will have to consider, actors’ restoration, player’s status, player’s location, environment interactions and so on.
The way that Square Enix studio did (for example) to the Unreal Final Fantasy series is they re-load the level again and restore the save game so that all the actors, quests, AIs, and environments are restored except for the location and the player status which loads from the save game. This is a great way to respawn the player but the downside is that you will have to kill the same enemy again.
In other games like Days Gone, I can see that they even save the status of the enemies. You can still find the dead body exactly at the killed location scattered around the map. This way you don’t have to worry about killing the same enemies again, but you will have to do the extra work.
So, again it totally depends on your game design. These are just the ideas on how you can make it work. For multiplayer, they just teleport the actor to the start location as you don’t want to force the player to re-join the server and cause catastrophic.