So, I have my player with 5 HP (health).
And I have an animation with 5 frames. Each representing the number of hearts of the health. Each damage, player loses 1 HP (and 1 heart from animation).
What I want to do, and I'm not being able to, is something like this:
If HP = 5, set animation frame to 1
If HP = 4, set animation frame to 2
And so on.
What is happening is that the animation is not changing upon receiving damage, and is playing from the beginning as well (not being triggered by the value change).
Any idea on how to do that?