I am trying to implement a progress bar system for my game. I know that it could be done with Unity's OnGUI and scaling with width of the texture but I don't want it to be a GUI element because in my game we would have several progress bars for each specific item.
In the below image you can see two of the progress bars and they are textures mapped on to a plane.
The actual progress bar that needs to increase/ decrease in width is just a gameObject. I could just localScale and just scale it in the x direction of the gameobject but that scales in both directions. So scaling is not a solution. How do I make it work such that it I could control its width? Is there any other way I could implement this system? Or could I just use Unity's OnGUI for this purpose? Thing is this progress bars need to show up in the game on top of several gameOjects in the perspective camera view. So I am not sure if OnGUI would work for that. Any ideas?
I want something similar to what we see in games like LoL where they have health bars on top of the in game characters like in the image below