Hello, I’ve got everything working for this lecture, but I feel like I’m missing something in the explanation.
I’ve set up the function in the HUD that casts to the ShooterCharacter Pawn and calls GetHealthPercent(). However, I don’t understand what is telling the HUD function when it should run. It seems to get called magically when the player gets shot.
I’ve played around a bit with setting CurrentHealth and MaxHealth on a key press during the game, and the ShooterCharacter’s GetHealthPercent() function seems to get called when EITHER CurrentHealth or MaxHealth changes, but functions don’t normally listen in for changes to variables they reference like that as far as I know, so what’s going on? The whole thing feels weirdly back to front.