- Home /
What's the best way to create a healthbar which represents the percentage of health the player has left?
The only way I can think of doing this is to create 100 different images, each one representing 100% health, then 99%, 98% etc.
This would take me a very long time, and it will be very repetitive to create the 100 different images of the health bar at different levels, and then the script with a hundred different states to swap around the GUI Texture which is to be viewing how much health the player has.
Is there a more efficient way to set this up?
I use custom shaders when I need to display gauges and meters. Of course, it all depends on how you actually intend to display them (icons, straight meters, circular gauges, numbers, etc.).
Your answer
![](https://koobas.hobune.stream/wayback/20220613081540im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Health Bar 1 Answer
Show GUI only when looking at an object? 1 Answer
How to make a Health Bar? 1 Answer
How to add texture in onGUI() 0 Answers