Help creating a health widget that ticks down when damage is taken.
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?
asked Aug 19 '17 at 03:22 PM in Blueprint Scripting
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.
answered Aug 21 '17 at 05:52 PM
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.
answered Aug 21 '17 at 06:52 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here