Multiplayer Health on Dedicated Server

I’ve been working on implementing a health system into the top down blueprint with a dedicated server.

In order to get each character to move around I had to use a method similar to this [(See Top Answer)][1]. Each player starts with an empty pawn and spawns the relevant character at the start of play. The player controller sends input to the server, which sends controls to the AI controller that allows the spawned character to move/interact.

I’ve managed to get the health to show on the hud and for each character to have the correct amount of health. My issue lies when trying to apply damage to a character. Rather than applying damage to the character that is in the area, damage is always applied to client 1 (even if the character is nowhere nearby). Here is a breakdown of how the health is instigated at launch.

And here is what happens when another player enters the damage area:

I can provide more screenshots if necessary.

Hi Zyrus,

In your 4th image I believe lies the problem, you are casting to Player Controller 0, so it will always affect the first player and no others.

Yep, just tried it out and it works perfectly now! Cant believe it was something that simple. Thank you for pointing it out to me :slight_smile:

How you fixed it? You created an event for each player index?

In this instance, the game was designed for only 3 players and so in each characters blueprint I changed the player index for the event.

I am basically having the same problem. Can you specify how you changed the player index to the correct one and how can I read the index from a player?

Hopefully this will be of some help, although it has been a while since ive worked on this.
To change the player index for the event you just need to change the value in the Get Player Pawn.

What that value is depends on which player you are playing as. This works in my situation because I specify at runtime which player I want to control which pawn.