Multiplayer - Widget Problem

Stilll need help with this

Hey W0hoho, would you mind posting some screenshots of your blueprints? It would be alot easier to see what’s going on and help =)

  • Samuelb

You need replicate this value, also you can add this information to Player State or Game State.
Next step you need create widget on all clients by him self (and listen server), dont try to replicate widget spawn on server.

can you explain more? how can I seperate players’ variables for same character?

Thanks for the reply.

I can’t share screenshots right now unfortunately. When I use text render everything is fine but widgets show different. I want to know what to do in widgets to show correctly. I bind progress bar to base character’s health variable and the variable is replicated. They are shown correctly on texts.

Also, I don’t know how to do it in PlayerState. I couldn’t find a documentation of Epic Games about Player State.

Hey W0hoho!

Is this the kind of functionality you are looking for? Both players update their own Health (and the other players health) in their own widgets:

Sorry for the bad picture, but you get the idea, is this what you want in your project?

-Samuelb

Yes but with a progress bar above each player’s head.

Hello. I am making a multiplayer game with host/join system. I made apply and receive damage events but character’s health bar does not change on both server and client or it changes both of the characters. I look characters’ healths with text on event tick and it shows okay, there is no problem with applying or receiving damage. I just need to figure out how to show it with widgets bars for each character. Can anyone help me with this?

Hey W0hoho

Have you checked out this video series? Blueprint Networking Tutorials - Unreal Engine
This is not a straight answer to your question, but you could maybe get some leads from watching especially part 5 and 6.
It helped me alot.

Hope it helps!

-SamuelB

I will check them out, thanks!

Awesome, good luck and happy learning! =)

-SamuelB

I haven’t managed to check this out yet, but it looks like this project could have some useful stuff, hope it helps =)
-SamuelB

Hey SamuelB, thanks for the link, it helped a lot. I didn’t know about this tutorial. I am glad you shared this.

I am still having with HUD stuff on multiplayer. HUD should be arranged like a single player project or does it also have special network settings?

I hope I made my issue clear.

Hey glad to hear that you found the videos useful! Did you try with a textrenderer component above your character like in the video? Or do you need a separate hud? It would be easier to help if you post some pictures of what you are doing in the blueprints. I would like to know how you have initialized your health, do you have the health set to replicate properly?

It might also be useful to store the health variables separately in your own “gamestate” or “playerstate”. I’ve managed to display the score of both players with this method in my own game: Both players can see both Scores update.

-Samuelb

Hey, ok now I understand what you want ! =)

Anyways I was trying some stuff out while doing my own project and I managed to get it working with a progress bar.

Here is what i did:

  1. I created a new widget bp that has a progress bar.
  2. Added a widget component in mycharacters bp and set the widget class in the details panel to be the new widget i created.
  3. I set my health value to be a “repnotify” replicated FLOAT value. (after which it makes a function called onHealth_repnotify)
  4. Inside onHealth_repnotify i added this code (see second picture ). What is happening is every time the players health is updated, this function fires and updates the progress bar to the new value.
  5. I also added the same function to fire “On begin play” so the function is initialized when you hit play. ( instead of it only updating when the health changes).

here are the screenshots, enjoy!

check out tesla’s video, this helped me achieve this, he’s got a bunch of good videos worth watching =)!

-Samuelb

It worked. Thank you so much for your effort and all.

No problem, super glad I could help =)! I learned a thing or two as well! =)