Problem with UMG Widgets in Network mode.

Hello everyone! I have been trying to figure this out for a long, long time and I am running out of ideas so I figured I would try the forums to see what people think. Sorry if this is totally a bad place for this, I have been having no luck at AnswerHub.

I have a widget with health bars created inside my MainController BP and it works fine on the server, however on the clients the UMG bars are not showing the health properly. The widgets appear, but they are not being filled.

This is what it looks like on the server when working properly:

This is what it looks like when it’s not working properly on the client:

This is the order of things being called:

Inside my PlayerController:

This is the setupUI function itself:

And this is the function bound to the UMG widget I am creating:

I can provide more information about the game if needed, thank you!

Project files:

Have you tried adding an actor/pawn var to the UMG and setting it to the owner pawn when you create the widget. That way, you wouldn’t call get owning player->get owning pawn. You would reference the pawn directly from the var in the UMG. It may work…Let me know.

I tried this:

But the result is the same. However I figured I should also mention other things I noticed that seem odd.

This is what the server UMG looks like when I start the game:

This is what the client looks like:

Now after I use the server to host the game, without doing anything the UMG widget on the client now appears as if it was working properly (it looks exactly like this But when I go to join the server, it goes back to looking like this

So it’s like something is overriding the UMG widget or something, but I thought thats what checks like “Is locally Controlled” fixed?

I also tried doing this:

as recommended here: Problem with UMG / Networking 4.5 - UE4 AnswerHub

But the issue is the same… I am really running out of ideas :frowning:

Hello Timetravel, do you spawn the characters in manually using a Spawn Actor From Class node somewhere?
If you don’t, you probably should; that worked for me.

When spawning an Actor draw the UI from his blueprint using the Create Widget node. This way every pawn has it’s own ‘instance’ of the widget.
Then you simply bind the health value to the progress bar, and then it should work. :slight_smile:

If that doesn’t work try the following:

1 - Create a Blueprint Interface, give it a function with 2 outputs: currentHealth and maxHealth.
2 - Go into your characters blueprint and in the Class Settings under Interfaces add the previously created Blueprint Interface.
3 - Then go to your widget and in its Graph tab, open the Class Settings and also add the Blueprint Interface there.

4 - Go back to your Character blueprint and open the function that you created in step 1 (this became accessible in your Character Blueprint when you added the interface in Class Settings)
5 - Create two float variables: currentHealth and maxHealth and connect them to the corresponding function outputs also called currentHealth and maxHealth.
6 - Now go to your widget and create a binding for the percentage of the healthbar. Name it anything you like.
7 - In the binding, place a Get Player Pawn node, drag off of it and get the function you created in step 1 with (Message) behind it.
8 - You should be able to drag off of that and get currentHealth and maxHealth. Divide currentHealth by maxHealth and put the result as the percentage for the Progress bar.

Let me know if this works. :slight_smile:

Yeah I already do this.

I also tried the method you suggested but this time the bars just remain empty. I’m going to upload my project soon…

This sounds stupid but: did you do some debug output, are you really sure the client player’s character health is set properly?

I looked at the debug inside the designer window of my widget and I only see one instance of the widget BP on the client side and two instances on the server side.

I have uploaded my project files here: