I have been trying extensively to find a way to allow a fill-up bar without having to use UI. My image for my game is to be able to watch the health of an enemy diminish over its head while attacking it, hit by hit. The one problem with this is that it appears to be impossible. Or so I think. I cant seem to find a way to do this and I’ve been playing with options extensively. Worst comes to worst, I just make the center of the image on the far left side and decrease the horizontal size throughout every update. But that seems very un-efficient. Any ideas?!
Heres a picture below to represent my idea:
I have attached a shader for the solution of your problem. You have to make a material and give this custom shader to that material. Select your material on your health bar sprite. You will get the option of fill value. then use that value accordingly. One thing you have to check shader may work in vertical not horizontal. If that problem comes open shader file and check x and y. Try to replace them and check. [100919-shaderforfillup.zip|100919]