Progress Bar goes to zero percent

I have many instances of a BP (called Unit) and I am trying to get each instance to have its own health but all sharing the same HPBar widget. I’ve got it set up so that only one actor is damaged and only his Hpbar is affected, but the bar goes straight to empty the first time he’s damaged.

Level BP, OSquad1UnitLeader is one of the instances I have of the Unit BP:

Unit BP:

Unit BP continued:

This is what happens when I press ‘o’.
OSquad1UnitLeader is the guy in the first lane at the top, the one standing in front all the way to the right. His personal HP is listed in the middle of all of the 100s (you’ll see a 90) but his HPBar is empty instead of only missing 10 HP:

P.S. There’s a small chance this might be occurring because I am setting up the individual instances’ HP wrong, but that is only because I have no idea how to properly setup many instances of Unit Bp to all behave the same but also having them not all get hurt when one of them gets damaged. I got this far through trial and error mostly…so I am seeking some advice in that aspect as well! :smiley:

First, try printing the value of hp percent right before you set it to the progress bar, that may tell us more.

you’re dividing HP by 100 and it’s an int. this will result in a decimal, but as an int will return 0. you’re then setting the value of your float to zero expecting it to be an float (0.80) or something to that effect. You need to divide your HP by a float of value 100.0 or use floats through the whole process.

I hope this helps. If this solves your issue please remember to accept the answer for tracking purposes. And so that my reputation will go up to 15 so i can flag posts about Paquiao vs Bradley as spam. :slight_smile:

Thank you dsmith, that worked perfectly! Also thank you Nunes for that suggestion, now it’s much easier to error check when there’s only one string being printed and only when it is updated :stuck_out_tongue: