I'm in the process of making a game. The enemies that I have each have 3 health, and each time they're hit, one health is removed. I was wanting to have a health bar show up above them to indicate how much health they have left.
However, I'm having trouble getting the health bars to pin to the right enemy. All of the health bars are pinning to one single enemy and only moving with that one.
I want them to show up like this:
But they keep only pinning to the enemy on the bottom and moving relative to him:
I have different animation frames for the health bar object that I was going to change them to according to how much health is left for the enemy.