Multiplayer Respawn Problem

Hello, I am having some problem with multiplayer respawning player on death. So I have a function in Game Mode takes care of the respawn, here;

And in Game Player Controller I have another script called Respawn Request, which calls the function in the game mode. here;

And, I call this function in the player controller, in the actual player when he is dead.

So the problem is, as you can see I binded X to respawn as well. For debugging. When I press X, server player and client respawning themselves which is totally fine. But when I shoot one with the other, the problem begins. If client shoots server, server gets respawned, which is what I want. But if server shoots client, server himself again gets respawned.

So I dont understand why X key is working fine on respawning but when I call it on damage it doesnt work fine. Thanks in advance.

From the pictures you posted, it seems the problem might be that your Respawn event in your PlayerController class is is a server only event. The server always has the PlayerIndex = 0, when you are a listen server. So when you are using your event only on server it always gets the server PlayerController. For a dedicated server it is similar. you are always getting the first player.

Hope this helps.

That solved the problem. Even if I put Get Player Controller instead of Self, it goes back to the same problem again. Get Controller and Self are working fine.

Do not use GetPlayerController(0). Instead use

215052-7023f7bb5d582454eefba788ed1c3b02.png

Could you please accept my reply as the answer cliking on the green icon? Thanks!

Do you remember what it was? I’m having this problem also but i cant see the picture.

Hello! Yes, If I recall correctly it was the “GetController” node. Although this might not solve it for you. If you still have issues I recommend you to create another post in a.h. with your problem. Regards.

1 Like

Thanks! I figured it out, GetController did not work for me so I did Get all Actors of class player controller and a for loop to check if it == get player controller with a branch. for some reason this worked for me but not get player controller, weird.