Question by
gruvgubben · May 14, 2017 at 07:09 PM ·
materialcolor
Whys isnt the gameObjects changing colour?
This script doesn't seem to work for some reason. I've tried col.gameObject.SetActive(false); and that works totally fine. Why isn't the gameObjects changing colour please help!
private void OnMouseDown()
{
foreach (Collider col in colliders)
{
col.gameObject.GetComponent<SpriteRenderer>().material.color = Color.blue;
}
}
Comment