How to kill a player in a multiplayer game ?

Hello, i have been working on a multiplayer game where i could shoot people and they would die but the problem is that for the death if i only do a “destroy actor” blueprint node it destroys the mesh but the player is still in game and “destroy session” node didn’t work.

Does anyone have a solution ?

First, you need to do this on the server.

Second, by default, a player controller is still connected to the server, even if their particular Pawn happens to be destroyed. If you want to kick the player from the server, you need to UnregisterPlayer that player controller, or use GameSession::KickPlayer. Although you’d probably also want to first tell the player controller that this is happening, so the client can know to return to whatever matchmaking service you’re using, and not attempt to immediately re-connect or anything.

1 Like