im trying implement health to my player using unity new UI Image system.but its not working.can anyone help me.Thank you.
using UnityEngine.UI;
if (health_value == 3) {
GameObject.Find("health").GetComponent<Image>().color.a = 1;
GameObject.Find("health1").GetComponent<Image>().color.a = 1;
GameObject.Find("health2").GetComponent<Image>().color.a = 1;
}
im getting this error.
error CS1612: Cannot modify a value type return value of `UnityEngine.UI.Graphic.color'. Consider storing the value in a temporary variable