Download

On player death and respawning

Hello!

I’ve got basic player death in place; at any point health reaches 0 or below, input is disabled, the character ragdolls, and they are essentially “dead”. Now comes the tricky part - getting them back into the game! Has anyone successfully ventured into respawning with blueprint? Not looking for someone to do this for me, just looking to kick around ideas on how this can best be accomplished, and pick peoples brains who have already accomplished this.

My first idea is to teleport the character to an unused spawn point, re-establish controller input, and re-initialize their attributes - I haven’t had a chance to implement this just yet, but it seems fairly basic.

I’ve also considered spawning a ragdoll physics actor in the same location/same vector as the player, hiding the player, and disabling their attack / input aside from basic movement, so that they essentially become a “ghost”, and must find their way back to a “Resurrection shrine” or something to that affect before the character would become visible and regain full input control.

Any ideas or input is appreciated!

I’d say if you are aiming for single player there is already tutorials. but if you are aiming for multiplayer capable ones from pure blueprint, it might not be possible yet.

The normal pattern here is to spawn a new Pawn and have the PlayerController possess that one. This is one of the advantages if the Pawn/Controller split.

Thanks for the input James. I was a little put off by my inability to get the proper player index in a multiplayer game, so I attempted to gerry-rig death and respawn with a persistent character… it works, but obviously not optimal. Is there an easy way of un-possessing a pawn and re-possessing it with the proper indexed player?

I definitely think it’s possible, you just need to redefine what player death and respawning is. Like I stated, disabling input on a given character, dropping a skeletal mesh in their place, setting them to “owner no see, only owner see” and re-initializing their attributes and specifying a new location is pretty close, and all of that can be done via BP.

Yes, it’s possible, I’ve done it properly after going through source code. And that is proper respawn, not some gimmick hide pawn tricks.
I’ll post the result later on Tom’s multiplayer BP thread. 2 nights doing search in source files gets me a proper understanding how to do it. :smiley:

What I did was create a delay for 2 seconds and then an open level.