Hey everyone, im currently stuck at the point where i can change image’s color with default colors but not with the colors declared in inspector tab (under the script). It changes the color of image in inspector tab, but not in the game. For example;
sq1.GetComponent<Image>().color = Color.blue;
code above works perfectly when i call this inside the update function. But when i get colors as input like:
public Color defaultColor;
public Color frameColor;
sq1.GetComponent<Image>().color = defaultColor;
This doesn’t change the color of image, instead it literally deletes the image. I declared colors in RGB code ( like sq1.GetComponent().color = new Color(41,135,45,255) ) but this doesn’t work either. I can just use predefined colors.
Thank you so much for your interest.