public static void ChangeColor(GameObject obj, Color color, bool Randomize=false)
{
if (!Randomize)
{
obj.transform.GetComponent().material.color = color;
Debug.Log("Color Changed!: " + obj.name+ " "+color);
}
else
{
color =new Color(Random.value, Random.value, Random.value);
obj.transform.GetComponent().material.color = color;
Debug.Log(“Color Changed Randomly!: " + obj.name+” "+ color);
}
}
I have the following code and when I run the program, the logs show up but the color does not change, what am I missing?