Respawning - multiplayer

I am currently trying to implement a multiplayer respawning system so that every player gets respawned 2 seconds after their death. I implemented some of it, but the way it currenttly works is if I kill 3 players, only the one that got killed last gets respawned and I have no ideas what to do as a workaround. The implementation is done in the GameMode blueprint, so that might be a problem, but I’d like to keep it there so that the respawning remains specific for the game mode. There is generally some more logic that deals with Victim Actor, Killer Actor and Killer Pawn which I have removed for the simplicity of the picture below.

I am out of ideas what to do as a fix.

Hi, I had the same problem in my game and for solve it I used a switch node after the cast as you can see on the picture.

285384-respawn-picture.jpg

You plugs the player index in the switch selection.

Another solution, if you have many players, is to call your event directly in player controller blueprint.

Did the solution work if you had more than 1 dead player? Also, the respawn call was in the game mode blueprint? Also also, did you call for the switch on int node in your Tick event?

Yes, the solution works for more than one player and you can call the event in game mode. You have only to add the blocks on the picture after your cast node, not need event tick. Moreover, you add as much switch pin as you have players.

Wait, from where do you call the Switch on integer? Event? Some integer?

For example you can call the switch node from a custom event containing a reference to the player who’s dead in input. Then you get the player index from this reference and you plug it in the switch selection input.

Yea, but I was doing almost the same in my original problem, and the problem was that it gets overwritten so the game respawns only the last player who got killed, but not the previous ones.

As I said, I had the same problem before and I solve it using this switch node. I think the problem comes to the delay node which prevent the event from executing respawn instantly so if a player dies before the delay, then the victim reference will change whereas the previous player didn’t respawn. So I suggest you this solution:

Otherwise if you have many players, call respawn from player controller.