Help creating a health widget that ticks down when damage is taken.

Hi,

I’m trying to create a health widget that ticks down past each integer of health when damage is taken. For example 100-90 health would display a quick flash of 99 then 98 then 97 e.t.c. I was just wondering if there is any way to do this solely in UMG or would I have to create a function to tag on when taking damage that runs the health down through each number?

Many Thanks!

If I understand, you want to display every point lost when damage is taken.
Try something like this in your widget :

Just set “currentHealth” with the health before damage, “HealthAfterDamage” with… the health after damage and set All Point Was Lost to false.
you can set up the display speed with the “speed” variable.

In the widget displaying your health bar or wherever you want the number to display add a text widget with the properties for font and size set to what you want. Set the visibility to collapsed or hidden.

When you update the health value set the hidden widgets text to the same value and set to visible and start an elapsed time variable. During Tick check to see if the elapsed time has expired and set the text widget back to collapsed. This will display the value for the elapsed time then hide it until you need it.

Thanks! I didn’t use your template exactly but it game me inspiration on how to do it so much appreciated! I ended up using an if Health and New Health are not the same, run a loop with the difference in health as the last index, added a delay and set Health -1 for the loop body. My health widget is already bound Health so it shows the ticking down health as it tuns through the loop. Can adjust the speed of ticking health by either changing the delay time of setting the Health to minus a higher number.