[Local Multiplayer] Unsure where to put respawn code for player pawns when using player controllers

So I’m working on a local multiplayer arcade ship combat game.

We have an issue with respawning more than 1 player at once. it seems when two players die, the last player to call the respawn event in the gamemode is the one that will get to respawn and all others don’t, and it does this in a sort of hijacking way. Say the respawn time is 5 seconds and player 1 dies, then player 2 dies in the last second of the respawn cycle, player 2 will respawn in 1 second and player 1 won’t respawn at all.

A quick TL:DR is the respawning event consists of a despawn and spawn event in the gamemode that switchs out the pawn the player controller is controlling, the player pawn does it’s death check and then goes to run the “respawn” event. These events are run in the gamemode though and when other players die while another is running through this “respawn” event, the new player that died will just jump in and take over the custom event. I need some way to run this respawn script privately for each player.

The way we respawn players is we have these two custom events in the GameMode, one that destroy the current pawn the player is using and replaces it with an empty one, and the other destroys this empty pawn and replaces/spawns in the real player pawn.

We simply have a thrid custom even in the gamemode that calls the these two events along with a delay between them. And this is called when the player pawn is killed in the game. (ignore the set bool for can respawn)

I created another custom event called “world respawn ship” for respawing player pawns in the player controller, which was an exact copy of the one in the game mode, thinking that would help but nothing will go in the target slot in the node calling this event when it’s located in the player pawn, and thus i get a compiling error.

The only solution I could think of was to make it so each player could run a respawn script in the player controller and not in the gamemode, but yeah as shown above I can’t get that to work so I’m at a loss with what to do now.

I’ve purchased and watched a number of local multiplayer / multiplayer tutorials and I’m yet to see anyone cover doing anything like this, so if you have any ideas I can try to fix this or a tutorial series that covers you could show me I would appreciate it.

So this actually was fine. The only problem was that I was casting the Player Controller, and not the custom Player Controller I had made. After that I could plug the “WolrdRespawnShip” event into the player pawn’s death sequence as it would accept a target now.

Whew, talk about bruh moments.