Circular Health Bar with dynamic material instance not working correctly

Hi guys, so I’ve been trying to figure out for weeks now why my boss health bar is not working correctly. The boss character receives damage as shown below and the health bar value is updated in terms of color and opacity based on the scalar parameter input set up (both blueprints below)

so given this setup… why do I get the weird result (as seen below) where the green color representing 100% health for the boss is persistenly present while the health ring updates and adjusts RBGA values over time?

Thanks in advance for your help.

Hello jluko,

I believe the issue is the value you’re using for your lerp for determining the color. The value for “Alpha” on a lerp goes from 0 to 1, instead of 0 to 100. If you divide your Boss HP (or the value returned from Get Percent after the event has already returned) by 100, you should be able to get the correct value for what you’re looking to do.

Hope this helps!

Hi Mattew, perhaps I am not reading your answer correctly but my BossHP variable is a decimal value… i.e. 1 = full health (green) and **0.0 = no health **

BossHP = TrollHealth/MaxTrollHealth

Ah, I apologize. I was skimming over it quickly and looked at it incorrectly. I’ll continue looking at this.

Is Set Percent ever being called outside of this Event Construct call? If not, it will never update unless you destroy and recreate the widget. It may be best to bind this logic to be called whenever the Troll takes damage so that it can get the health percentage again and run through the lerp again.

Following this tutorial: Unreal Concepts - Different Shaped Progress Bars ( UE4 ) - YouTube
that question didn’t come up as an issue. However I’ll implement your suggestion over the weekend and report on the results.

In their tutorial, they’re calling “Set Progress” which is the same as your “Set Percent” from what I see, using a timeline so that it updates. You can see it around 11:25.

As it turns out, I was just missing an Event Tick Node instead of the Event Construct Node I was using all the time. I simplified my set up to this as a result. Thanks for your help though Mr. Clark :slight_smile:

That’s what I was suggesting. If you take a look at this logic that you’re calling on Event Tick, it’s the same logic you were calling with your “Set Percent” event.