Respawning in Multiplayer RPG

Hi guys!
I’m currently trying to make a good respawning system for a multiplayer RPG where progress is kept between deaths and variables of the character actor are not reset.

Since I don’t want the camera to “spaz out” when the player dies and the actors gets destroyed, I tried keeping the actor and simply disabling movement input and activating the ragdoll on death.

Then I tried changing the position of the player in my OnRespawn() to the position where I want him to respawn, and stopped all ragdoll action.

This gives me strange results.
I can respawn and move, but the model still lies there and the newly “respawned” player doesn’t have a model or collision or is replicated.

What would be a better way to respawn in the RPG scenario where progress is kept?

I want to achieve this, but I’m kinda out of ideas now:

  • Kill player, respawn and still keep the variables.
  • The camera should not move when he dies. It should stay in the position where it was just before he died until he hits a respawn button on a widget. (lesser problem)
  • The player should only be able to interact with the UI and not the game when he’s dead. That’s probably done with SetInputModeUIOnly()
  • Ragdoll should not be replicated, respawned actor should be replicated again.

In General, what would be a good way to handle respawn in that MP-RPG scenario?

You don’t need to spoonfeed me the code, I just need some information on where to start or maybe a basic bullet point list of how I could approach the different aspects of the problem.

Thanks for your time and help!

His stats (int values) and his inventory (TArray).
Basically all the stuff you want to keep in an RPG where character stuff is stored on the server.

What kind of variables are you trying to keep on the character actor?

You may want to consider moving that into the playerstate instead of the character. The character is better thought of as a wrapper for the actual pawn not the player.

The playerstate will exist regardless of what happens to the character, and it will exist across clients and on the server. The Playerstate should hold everything everybody needs to know about the player, the player controller is best thought of as the actual player, and the pawn is kind of just like a puppet whose puppeteer is the player.

Broad info here Gameplay Framework Quick Reference in Unreal Engine | Unreal Engine 5.2 Documentation

Ahh how could I miss such a basic thing?
Thanks for this, I will rewrite my code and mark this as an answer.