Sorry if this is kind of a long request but every health bar tutorial I look up only tells you how to make a single health bar with a fixed maximum health.
What I have now is a health bar sprite that's width is set to the health value of the unit.
What I'd like to do is:
1. Have it so the width value is set as a percentage of the unit's health, so that no matter how much maximum health the unit has, the health bar will always have the same maximum size.
2. Be able to attach this health bar to a variety of different enemies, so that I don't have to make a new health bar for each different enemy I make.
Sorry if I could have explained it better, that's the best way I can think of describing it.
Thanks anyone for any help