Hi guys,
I have a healthbar attached to my prefab enemy tanks in a “desert strike” clone I’m building.
I have created a healthbar slider in a worldspace canvas and attached this canvas and script to my enemy prefab - It all works great so far.
Problem: I want to start the fill color at green and reduce it to red as the health value decreases. I know how to lerp the color, but I just cant work out how to actually change the color of the object! I have scoured the internet for an answer to this but its not even in the unity scripting manual!
I understand the fil color is at: Slider>Fill Area>Fill>Image>color. But how do I change this in c#???
Cheers