I’m try to get my project working for multiplayer and debugging a lot of stuff, but pretty new to the replication side of things. Here is what the HUD looks like in game. The health (red) does update when I spawn in… I.E. I set it to 90% and it shows that, etc.
But it won’t update after the intial spawn. I have a button I press to restore health, and it’s not updating the HUD. Every tick I “update stats”
That event triggers these events:
These events than update the HUD
This works fine in stand alone, just something with playing in a listen server. But the server player and client player don’t update.
Thank you for any help!!
I did find one intersting thing out. When playing in the server viewport, when I press the heal button, it update the HUD for the client. So it shows the client HUD now at 100/100 instead of 90/100. But the server (who’s HUD I want to update) doesn’t change. The inverse doesn’t work - when I heal as the client, the server’s HUD does not change.
Here is how the HUD gets assigned to a player pawn
The problem may be is that you need to create a widget only on client side and that widget should only calculate your HP bar on client side as well (so those events you showed that update the hud), while logic for replenishing the health should go from client>server>back to client. https://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf Here’s a great link for better understanding of how replication works and how certain entities like HUD and stuff like that are replicated.
Thanks Seth, great material, thank you for sharing! I did get this fixed - for anyone else having the issues here is what I did, super easy.
I literally just had to change what I was using in my cast in the HUD Widget. Switching from player to binds to “Get Player Pawn”
I did set p the variables as replicated or w/ notify… but I don’t actually think that matters as I’m not using the notify for anything