Why are all my Characters Health bars linked?

link text

Hello. I am following tutorials on youtube on making a RPG. I have a thirdpersoncharecter that has a widget component floating health bar and energy bar over its head. The character can punch, kick and energy and it is set up to take damage. The problem is when ever i duplicate the thirdpersoncharacter or make a child and attack it, its like they all share the exact same health bar. All of there health bars are linked. The punch affect all the characters at once even the ones not around. How do I make it so that I can duplicate my TPC or make a child and fight them and they have separate individual health amounts? I tried to explain it the best I can. There is a video. Thank you.

What is the health bar linked to? Did you bind it to a central variable in the game instance, for instance?

It needs to be bound to a variable in the character.

Okay I see what you mean. Inside the ThirdPersonCharacter there is a Health float variable that is replicated (Energy as well). When ever I link the UI Health bar to the Health variable its empty and so is the energy. So now I have inside the UI health bar is a function called get health bar precent that is casted to the ThirdPersonCharacter and has the health threw that function. I will attach the images. Thank you so much I really appreciate the help.

All the default values are set to 100 but the sliders are still empty.

I’m looking around, I saw:

https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1593321-multiplayer-health-bar

Also this ( don’t copy the code ):

https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/103763-multiplayer-widget-explanation-why-this-is-working-and-that-not

Thanks so much I appreciate the help. I will look it over and let you know if i get it going.

Problem Solved. Thanks so much for the help. I think the problem was a bad cast to the 3rd person cht in the health bar UI. I re did the 3rd person cht ref and binded the health bar directly to the health float in the 3rd person cht. Everything is replicated and everyone has there own heath and energy working independently.

Excellent :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.