Want to try something else than the Delay

This is true, delays are cursed. Timers are delays. With them you take your code out of a natural order into the future where it might or might not execute, this becomes messy and hard to debug. You can also not use delays in blueprint functions.

I prefer using the observer pattern (delegates, called Event Dispatcher in blueprint), so when something happens (event broadcast) a ‘listener’ immediately responds. Since you want to display a red tint when your character gets hurt, the broadcaster of the ‘hurt’ event should be your character and the listener a UI element which displays the tint. This keeps tint logic out of your character who is not supposed to do anything else than be a character.

https://www.youtube.com/watch?v=sEcoWGrF1Hg

1 Like