# Health bar still not working

**URL:** <https://forums.unrealengine.com/t/health-bar-still-not-working/487263>\
**Category:** Community & Industry Discussion\
**Tags:** health, health-bar, unreal-engine, question\
**Created:** [August 10, 2021, 3:20am UTC](https://forums.unrealengine.com/t/health-bar-still-not-working/487263 "2021-08-10T03:20:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_9a7ed577](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9a7ed577](https://forums.unrealengine.com/u/anonymous_user_9a7ed577)\
**Post date:** [August 10, 2021, 3:20am UTC](https://forums.unrealengine.com/t/health-bar-still-not-working/487263/1 "2021-08-10T03:20:13Z")

</div>

I have the following Blueprint setup and my health bar still isn’t working. I’m not sure why. Any help would be greatly appreciated!

 ![346002-gethealth.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/7/f/c7f44e770806564ba7dfe6bf5bf770fb1701e101.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 10, 2021, 7:55am UTC](https://forums.unrealengine.com/t/health-bar-still-not-working/487263/2 "2021-08-10T07:55:00Z")

</div>

- how is the character spawned, how does it get into the world?
- does the cast fail?
- if you print the result of the division before the return, what does it print?
- what values are expected in the Heath and Full Health vs what they really are when while this executes?
- is this character possessed? are you controlling it?
- could demonstrate how damage is applied and how the variable is updated?

> my health bar still isn’t working

Could you clarify what that means? As in:

- my car is not working - it’s in the ditch, on fire

or

- my car is not working - when I press the break pedal, it does not slow down and heads straight for the ditch

Asking for details 😉 The progress bar is there but not moving, it’s moving but incorrectly?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9a7ed577](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9a7ed577](https://forums.unrealengine.com/u/anonymous_user_9a7ed577)\
**Post date:** [August 10, 2021, 1:47pm UTC](https://forums.unrealengine.com/t/health-bar-still-not-working/487263/3 "2021-08-10T13:47:49Z")

</div>

The health bar shows up on the screen but does not move at all. For instance, it does not decrease at all when you would expect it to when the player character gets hit or takes damage.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9a7ed577](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9a7ed577](https://forums.unrealengine.com/u/anonymous_user_9a7ed577)\
**Post date:** [August 10, 2021, 1:50pm UTC](https://forums.unrealengine.com/t/health-bar-still-not-working/487263/4 "2021-08-10T13:50:18Z")

</div>

Yes, this function is bound to the progeess bar.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 10, 2021, 2:08pm UTC](https://forums.unrealengine.com/t/health-bar-still-not-working/487263/5 "2021-08-10T14:08:30Z")

</div>

Could you clarify the rest, please? I’ve updated the list.

Under regular circumstances, this should work _as is_. There’s clearly something irregular here, hence the questions.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9a7ed577](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9a7ed577](https://forums.unrealengine.com/u/anonymous_user_9a7ed577)\
**Post date:** [August 10, 2021, 4:06pm UTC](https://forums.unrealengine.com/t/health-bar-still-not-working/487263/6 "2021-08-10T16:06:18Z")

</div>

The character spawns at the start of the game, I have not programmed a respawn.  
I’m not sure if the cast fails or not, the magic bar works just fine with the same set up.  
The values are 1000 full health with a 200 hit loss each time.  
I am controlling the character

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 10, 2021, 4:31pm UTC](https://forums.unrealengine.com/t/health-bar-still-not-working/487263/7 "2021-08-10T16:31:43Z")

</div>

> I’m not sure if the cast fails or not

`Print String` off the `Cast Failed` pin. This (very inefficient) bind executes every frame so you’ll see the Print String spam the log.

You’d generally go for Event Driven approach with something like this:

Player Lost Health → Update Widget

Unless the health constantly changes every frame, of course.

* * *

> the magic bar works just fine with the  
> same set up.

If you have an identical setup already working for another widget, this should be a matter of comparing the two, no?

* * *

Also, gonna link the two:

> [@Can't get my health bar to work, not sure if it's the code or the Blueprints](https://forums.unrealengine.com/t/cant-get-my-health-bar-to-work-not-sure-if-its-the-code-or-the-blueprints/244682/7):
>
> yes, it’s still bound to the percent variable. How would I check to see if the cast is failing?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9a7ed577](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9a7ed577](https://forums.unrealengine.com/u/anonymous_user_9a7ed577)\
**Post date:** [August 14, 2021, 12:15am UTC](https://forums.unrealengine.com/t/health-bar-still-not-working/487263/8 "2021-08-14T00:15:30Z")

</div>

The cast did fail, nothing happened when I hooked it up to the Print String. So what do I do now to fix it? Sorry ot took me so long to get back to you.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 14, 2021, 7:52am UTC](https://forums.unrealengine.com/t/health-bar-still-not-working/487263/9 "2021-08-14T07:52:11Z")

</div>

> The cast did fail, nothing happened  
> when I hooked it up to the Print  
> String.

Just this one thing does not make any sense whatsoever.

If the Cast Fails, it _would_ Print String off its pin.

You may need to clarify in great detail what is going on. What you’re showing should work _as is_, and we cannot possibly start guessing what else might be off.
