Complex Health System

Hello fellow Unity developers,

I have two GUI icons, one for an empty health slot, and the other for a full health slot. May I ask how I can implement this health system so that the health bar is full and as the player receives damage the full slot is replaced with an empty one. Also I need to know how to make attacks actually decrease teh health and how to use items (food) to heal.

Thank you

Very commonly, people have it so that there are multiple graphics (GUI Icons) per a damage.

If you Google, you can find many examples of them (I believe burgzerg or something like that did a tutorial on this on Youtube, or like burgzergarcade.com, again, Google).

But that’s how most do it. Besides this, you can change the width of a graphic bar to change when health is changed, just change the width.

Good luck!

Just search the codes by typing GUI in the Scripting Reference and you’ll find something useful for adjusting the widht.And by learning them you’ll understand how to do.