Question by
Master_Davicous · Apr 29, 2016 at 06:25 AM ·
c#colorimagegetcomponentlerp
Changing image color from other object's script (glitch)?
So I made a health bar script for my character, and it's meant to change the fillAmount and color of my health bar. I had public Image healthBar; then I added the health bar to it. The fillAmount part works perfectly fine, but when I do:
healthBar.GetComponent().color = Color.Lerp(highHealth, lowHealth, healthBar.GetComponent().fillAmount);
my health bar just doesn't show up... I tried changing it without the Lerp too but it does the same thing.
Comment