Health Bars in Unity
It’s hard to find a game or even an app that doesn’t make use of bars to display information. In games, they are extremely common to present one of the player’s stats. Health (HP) being the most common one.
In Unity, there are a bunch of ways of doing a health bar. The easiest one, that’s built-in, is to add a UI Slider, remove the handle and adjust the fill rects.

Sure, it works. You’ll have to do it every time or you’ll have to create a prefab for it. It will be a hassle between projects. Plus, the slider has a lot of functionality to handle input. A stat bar only displays information.
We can use the slider as a base, remove what we don’t want, and increment with functionalities that suit our needs.
One-click Creation
Well, first let’s make it so we can create a new stat bar with a click of a button.

No changes are necessary. You get a health bar ready to go.
Min Digits
In many old JRPGS, you would always see a number of digits no matter the value. This option is also built-in the Stat Bar UI.
Color Transition
Another cool addition is that you can customize the color based on a given percentage. So when the value drops below 50% or 25% you can change the color to signal that.
On the script side, things are straightforward as well.

Here’s the URL for the repository.
It will make it easy for you to add as many bars as you want without cluttering your code with third-party scripts.