I’m trying to make a simple stamina/health bar, once the run button is pressed it will simply move on the left just to give the idea that it’s actually “shrinking” (I can’t directly shrink it, since it’s not a plain rectangle and since it’s animated behind)
How would it be possible to “Hide” part of the health bar while it’s scrolling ? Example Gratia :
on the right the health bar has simply moved left while being “hidden” in the first 50-80 pixels. I achieved this with a second orthographic camera where only the health bar was in it, then I changed that camera viewportRect x value to 0.05 and achieved that result. But this gives me problems if the game starts with differents resolutions.
Any Idea on how to solve this issue / or different ways to achieve the same result ? Someone told me to use shaders and z-buffers, but I know nothing about them