Apply a script to the children of a GameObject?

Hello! This is my first thread on the Unity forums, and I just wanted to ask a question. I have an Empty GameObject which consists of many cubes, and I want to go into the GameObject and change all of the Children with one script, because I know there is a better way than applying this script to all of the objects:

gameObject.renderer.material.color = Color.white;

Is this possible? If so, can I get a small example script or a reference that shows me how to do this?

Thanks a lot!

1 Like

Thank you! Exactly what I needed.