Hi!
I have an object with 5 child (4 Point light and a collider) and i want to change the color of the ligths when the collision happens. I need an invisible collider because the object looks like a donut, so technically i don’t collide with it, instead of the camera goes through it.
mainObject=other.transform.parent.gameObject;
for (var child : Transform in mainObject.transform) {
if(child.gameObject.name == "Point light")
child.Light.color = Color.green;
}
But this does not work. I tried child.gameObject.color, child.color and so on but i could not find the solution.