How to play a UI animation off of damage from an outside blueprint?
I have UI animations made in a widget blueprint that is cast to my player character. I want to play these animations when I take damage (an overlap trigger volume that detracts from my health value every second). I made a little red flash animation thats just changing the opacity and color of the default white image the ui widget gives you. Which blueprint do I have to edit and what do I have to cast to to accomplish this? Thanks.
You should have an AnyDamage event in your Player Character blueprint. You should also keep a reference to the Widget that you added to the screen (which includes the health bar). I'm gonna assume you do that in your player controller, but if you do it in your player character that's fine.
You should also have a custom event in your widget blueprint that plays the animation you want (PlayAnimation node).
When the AnyDamage event fires, you call the custom event in your widget blueprint, using the reference you saved when you added it to the screen, and it should play the UI animation you configured.
If you've got any further questions let me know ;)
answered May 09 '18 at 03:13 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here