# Multiple Health system

**URL:** <https://forums.unrealengine.com/t/multiple-health-system/402423>\
**Category:** UI\
**Tags:** hud, health-bar, damage-player, unreal-engine, UE4, Blueprint, question\
**Created:** [August 21, 2017, 3:14pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423 "2017-08-21T15:14:04Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Astiol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Astiol](https://forums.unrealengine.com/u/Astiol)\
**Post date:** [August 21, 2017, 3:14pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/1 "2017-08-21T15:14:04Z")

</div>

Hello!  
I made the Hp system. But I ran into the problem, HP should increase as the number of points earned by the character increases.  
Everything works correctly and HP really increases, but I can not display it correctly in the HUD.  
This system should work like this:

- 0-10k score - health (100)
- 10k-25k score - health2 (200)
- 25k-50k score - health3 (300)
- 50k - ∞ score - health4 (400)

Help me repair this system please.

 ![210599-calculatehealth.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/6/ca6a20e826dfd3c64d435fe2a63e547d55223979.png)

 ![210600-calculatedead.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/7/5/8757f31f2c33bfa264b9cb21755309eaa484220b.png)

 ![210611-herocharacter.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/5/b/15b49063f141657f36da48e077829dd9487b4007.png)

 ![210612-hud.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/1/5/a15d2d95c63eb9587904950f6c97a6f91d9bd0dc.png)

 ![210613-receivedamage.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/b/d/8bd32df335a9ad4c4bf011628e529a470b1bbb5d.png)

---

<div class="post-metadata">

**Author:** ![IGorilla](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IGorilla](https://forums.unrealengine.com/u/IGorilla)\
**Post date:** [August 21, 2017, 6:16pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/2 "2017-08-21T18:16:34Z")

</div>

Hey, how does the hud look like? Seems odd to me that you set 4 healthvariables but you only use 1 in the healthbar hud thingy.

---

<div class="post-metadata">

**Author:** ![Astiol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Astiol](https://forums.unrealengine.com/u/Astiol)\
**Post date:** [August 21, 2017, 8:42pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/3 "2017-08-21T20:42:39Z")

</div>

I do not know how to make such a system, since I just started studying the engine, I asked for advice from the Russian community, but unfortunately I could not get an understandable one, so I did it the way i know …

---

<div class="post-metadata">

**Author:** ![IGorilla](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IGorilla](https://forums.unrealengine.com/u/IGorilla)\
**Post date:** [August 21, 2017, 9:05pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/4 "2017-08-21T21:05:09Z")

</div>

well, you said you cannot display it correctly in the hud. Were you able to display anything? if so, what does it display

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [August 21, 2017, 9:33pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/5 "2017-08-21T21:33:26Z")

</div>

You made yourself a pretty Code Hell. Im in a nice mood so here a better Solution 😜 keep things simple mate.

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/1/5/8157d9c3fdb0b2df3c7caed5b928ff313ae9c388.png)

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [August 21, 2017, 9:38pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/6 "2017-08-21T21:38:00Z")

</div>

Wups made a little mistake in the Level tresholds. it should start with 0 than 10k, 25k … and so on. Everything else should be fine.

---

<div class="post-metadata">

**Author:** ![Astiol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Astiol](https://forums.unrealengine.com/u/Astiol)\
**Post date:** [August 21, 2017, 9:43pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/7 "2017-08-21T21:43:07Z")

</div>

Now the HUD blueprint looks like this, but it does not work as it should.

 ![210649-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/3/d/d3d256bf5e1833c303adff891d2eef3665983876.png)

 ![210650-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/5/ca573f20dfe371d0c52e2dd3c552575f9806a567.png)

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [August 21, 2017, 9:49pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/8 "2017-08-21T21:49:54Z")

</div>

and here some debugging and results 😜

> **[Gyazo](https://gyazo.com/171c2087f49ec73e01cd1e8c90eb14f4)**
>
> Easily capture screenshots, GIFs, and replays that are ready to share. Download the free app for windows and mac.

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/4/6/846b0c17d961656e22068f2975f8db7369a354dd.png)

---

<div class="post-metadata">

**Author:** ![IGorilla](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IGorilla](https://forums.unrealengine.com/u/IGorilla)\
**Post date:** [August 21, 2017, 10:06pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/9 "2017-08-21T22:06:06Z")

</div>

using the sequence will always result the first return node to fire, meaning ti will not go over the other 3. you will need a branch and check what healthlevel your character is at and use the right calculation for your health and return that.

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [August 21, 2017, 10:08pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/10 "2017-08-21T22:08:03Z")

</div>

x) still don´t get it why you try to fix that mess. Smart and easy Solution bellow. Takes literally 5 minutes to setup.

---

<div class="post-metadata">

**Author:** ![IGorilla](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IGorilla](https://forums.unrealengine.com/u/IGorilla)\
**Post date:** [August 21, 2017, 10:11pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/11 "2017-08-21T22:11:58Z")

</div>

The man asks a question, i try to answer 😛 I must say only with your answer i was able to figure out what he tried to achieve 😛 Messy indeed, but hey, i aint gonna judge 😃 Just helping him understand the engine. Optimization can come later (if he gets to that stage).

---

<div class="post-metadata">

**Author:** ![Astiol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Astiol](https://forums.unrealengine.com/u/Astiol)\
**Post date:** [August 21, 2017, 11:54pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/12 "2017-08-21T23:54:24Z")

</div>

Wow!  
Thank you !  
I will try this way))

---

<div class="post-metadata">

**Author:** ![Astiol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Astiol](https://forums.unrealengine.com/u/Astiol)\
**Post date:** [August 25, 2017, 3:36am UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/13 "2017-08-25T03:36:58Z")

</div>

Hello, excuse me for troubling, but i faced with one more problem.  
If i use your system only - result is wounderful, it’s very cool!)  
But when i use my variation of your blueprint all wrong, the points are in a different blueprint, and I need them to stay there. Could you please explain to me how to do this?

Your changed BP (working) - [http://imgur.com/a/8qlpF](http://imgur.com/a/8qlpF)

My variation of BP (mess) - [http://imgur.com/a/wzsf0](http://imgur.com/a/wzsf0)

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [August 25, 2017, 1:47pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/14 "2017-08-25T13:47:21Z")

</div>

Why you mix your Score mechanic with your Damage mechanic? Keep them separated. Your “Affect Health” should only decrese/increase health. Create a dispatcher in your Game mode and call it after you increase your score. Inside your character get your casted Game Mode and Bind to the Dispatcher (on Begin Play). No need to change the score mechanic I gave you =)

---

<div class="post-metadata">

**Author:** ![Astiol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Astiol](https://forums.unrealengine.com/u/Astiol)\
**Post date:** [August 26, 2017, 6:26pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/15 "2017-08-26T18:26:20Z")

</div>

like this ?

[[Album] latest ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/1/b012b8097b7c483a161fcb394b794bd8644e1ca4.jpeg "latest") ](https://imgur.com/a/HQyRl)

I asking you to spend a little of your time to make example, because today I tried more than 4 options,but nothing happened and for another I do not have enough skills.I really do not want to take your time, but otherwise I can not understand.

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [August 26, 2017, 7:26pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/16 "2017-08-26T19:26:10Z")

</div>

Almost 😜 you got to call your dispatcher in your GameMode and everyone who Listens to that Dispatcher “Binding” gets notified whenever the Dispatcher is called. Like this as Example:

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/d/56d3cf022d51f9e8bfce58a835c41dd6d470cc84.png)

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/c/e/3ce7f74df95dbbd23d7f9a63b85c31233bbf1f2a.png)

You also dont have to bookkeep your Score in more than one place. In the above example I send the score along but you could also get it from your Game Mode directly with a small modification like this:

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/6/b/a6b51a9d12db07c6267b78a3a75a3104603460be.png)

Here a recommandation of a Training Video that explains a lot of things including Dispatchers very well. Its a little long but worth every second for beginners: [Blueprint Communications | Live Training | Unreal Engine - YouTube](https://www.youtube.com/watch?v=EM_HYqQdToE)

If you still got Questions left feel free to ask.

---

<div class="post-metadata">

**Author:** ![Astiol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Astiol](https://forums.unrealengine.com/u/Astiol)\
**Post date:** [August 26, 2017, 8:26pm UTC](https://forums.unrealengine.com/t/multiple-health-system/402423/17 "2017-08-26T20:26:39Z")

</div>

Thank you! For blueprint and tutorial, it’s awesome)
