I’ve created an enemy health bar using widgets, and I’m wanting to display it only when that enemy takes damage from my character, and then disappear again a few moments after the damage was taken. I’ve got everything else working correctly, I just can’t figure out the logic to make this happen. If you need screenshots of any particulars just let me know. I’m not looking for someone to have to do the work for me, I just need a little help figuring this out. Thanks!
That’s simple, just make a Boolean variable ‘ShowHealth?’ and set it to true when you take damage, and then add a retriggarable delay after everything for take damage, and once the delay is complete, set the ShowHealth? variable to false. Only display the health if the variable is true.
Right, that makes perfect sense to me, and I was trying to do something similar, but how do I check and see if damage has been taken? I am aware of the “event any damage” node, but I can’t seem to make it work. Here is the blueprint for my damage to enemy:
Instead of checking when damage has been taken, just place the code that I told you after you apply the damage; alternatively you can create an event dispatcher that fires when your BP above runs.
You sir are a hero. Thanks.