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.
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!