[Multiplayer] HUD not showing up on Client

Hi!
I’ve searched half the day for an answer for my problem.

What I want to achieve: When a player dies, a “Respawn” Button should show up on his HUD. It works fine on the server, I just use an interface BP to send a “IsDead” bool over to the controller and then to the controllers HUD after the pawns health has reached 0.

However, if I want to do the same on the client, the clients HUD never shows up. If you try out the HUD level of the ContentExamples with 2 players, you will notice that the client can not press “M” for showing the menu - which is kinda the same problem I think…can anyone point me in the right direction ? I’m really new to UE4 so I apologize for this “noob” question.

Sounds like a replication problem. Have you checked networking tutorials on the UnrealEngine channel?

Yep, this really sounds just like a replication problem. When using the Multiplayer, the Server is the only one who can change replicated variables.

How exactly are you replicating the isDead bool over the network? Who is in charge of declaring a player as dead?
Normaly the Server applies damage and also registers when a player is dead.

Either you let the server check the player hp and set it’s isDead bool to true or you only change the HP of the client and let the client check the hp variable itself to change the isDead bool.

Either way, you need to have a replicated varaiable that is set by the server to the player who died.

Thanks a bunch for the answers & explanations!

Originally, I changed a bool in “Event Any Damage” (which only works on the server). Then I sent that bool over to the “Interface BP” to the Controller, and in the Controller I sent that over to the Controllers “HUD BP” (because I couldnt get the HUD in the “Character BP” for some reason).

I think it didn’t work because “Event Any Damage” will only be executed on the Server ?

I resolved that problem yesterday, got some help from the IRC. (Thanks to Ypsylon!)

Now i do the following: If Health is <= 0, I get the controller and cast to “MyController” and in the “MyController BP” I call a “Custom Event”, which only executes on Clients. I get the HUD, cast to “MyHUD” and then I just “Toggle the Respawn Button” (which is a bool over the interface) so when the “Event Receive Draw HUD” executes, it checks if that bool is true or not and if true, it draws the button. Is that the right way to do that or is there a better, easier way ? Shouldn’t it be possible to use an interface from “Character BP” directly to the “HUD BP”, so I don’t need to go there over the “Controller BP” ?

The same issue I have with sprinting. Somehow, if I change the Walk Speed when pressing “Shift+W”, it doesnt work on the Clients. Do I need to make a “Custom Event”, which only executes on Clients, to make this work ?

I’m not so familiar with interfaces.

The sprinting issue:

Normaly i use a Custom Event that is set to “Run On Server”.
And than i update the variable for sprinting per tick.
So if i change it locally on a client, i will be set by the server.

Or at least i have this in mind. I just woke up so maybe later the day i will have a look into my project and tell you how i sprinted in multiplayer.

But maybe you can solve this if you think about how to use the Custom Event or Replicated Function, like they are called in the tutorials.