Progress Bar Not Depleting

I’ve followed this tutorial https://docs.unrealengine.com/latest/INT/Engine/UMG/QuickStart/4/index.html to get a health bar working in my game. It displays fine but for some reason it won’t change state until the variable is empty. This is what my Health Bar Blue Print looks like

And this is what it looks like on screen

The integer on the right of it is used to confirm my health value is decreasing and has been linked to the blue print, which it does. The value should start at 3 and every time I press F it decreases by 1. Here’s what it looks like when it reaches 0.

I’ve looked around a bit and I’ve seen some other people have this problem but I haven’t been able to find an answer that works. I’m using Unreal Version 4.4.3 if that helps matters.

Hey!

I had that issue not too long ago. I don’t know if you’re still looking for an answer, but I can tell you that if your health bar works in percentages, the thing is your value can only be situated between 0 and 1. So what happens is that you’re feeding your health value (which goes up to 3) directly into the health bar formula, and essentially your game thinks you have 300% heatlh, then 200%, then 100%, then straight to None (0%) since your hit takes away 100% a shot. Follow my drift?
Essentially, you have to keep your value between 0 and 1. To do this, you might want to make a small little sleight-of-node and use a “integer/integer” node. Just bring your currently Health value into the top part of that node, and write the max amount of health you can have in the bottom part (or create a variable that equals your max health, if it’s better for you intentions). This should always give you a value of a max of 1 and a minimum of 0, and it should show correct progress.

Hope it helps! GL! :smiley:

Hey. Thanks for the reply. I’d forgotten I asked this question. I managed to figure out the solution of my own and simply divided the number by my max health before returning the number. It’s good that you answered though, this question can be marked off as resolved.

Good! I’m happy to read we came to the same solution and that your project worked out anyways :slight_smile: Sure you can just Accept this Answer and stuff and that’ll resolve your question :stuck_out_tongue: