- Home /
Question by
Waterdropz · Jul 29, 2014 at 05:38 AM ·
animationinstantiateguitexturehealthbar
How do i animate my health bar so when i take damage it lowers and changes colour.
This is a picture of my health bar ~ http://gyazo.com/2c837edb3cc570ebe1f855aa94c6014f
Should i make 50 versions of it slowly reducing the green bar? I know there are many solutions for this, but my healthbar has a different shape, im not sure how to work around this.
Comment
Answer by robertbu · Jul 29, 2014 at 05:41 AM
The technique used for the circular progress bar will work with your shape:
http://answers.unity3d.com/questions/14770/creating-a-circular-progressbar-timer.html
You can handle the color either by using a version of an alpha cutoff shader that supports an overlay color, or you can make several textures (complete fills) in different colors and swapping the textures as needed.