Script to change the color of all children in a parent object.

So I’m currently working on a game where there is a safe path to walk on and the rest of the area crumbles and falls and the player dies if they don’t take the right path. So when a player enters the level and walks over the trigger object, it should trigger the safe path tiles to turn yellow. I want a timer on it but that’s irrelevant at the moment as that’s easy to add.

The problem I can’t seem to solve is how to get multiple, specific objects to highlight yellow. Ultimately after some debating, I decided to child all the safe path objects to the trigger tile and try to change all the children with a script but even that failed.

I think I have a solution by making all the safe tiles have the same script and to change color if the player tag collision hits the trigger tile and I have it and only it have specific tag to trigger. I can’t try that now since I’m not home but that just seems messy and I was hoping someone could help with a clean, simple script that allows me to change all my children to yellow when my player character walks over the trigger.

Here is the last attempt at a script to change the children’s color to yellow.

private Color lastColor;
	private GameObject[] safefloor;

	void start()
	{
		lastColor = gameObject.GetComponent<Renderer>().material.color;
		safefloor = GameObject.FindGameObjectsWithTag ("safe");
	}
	void OnTriggerEnter (Collider other)
	{
		foreach (GameObject go in safefloor) {
			//if (other.tag == "Player") {
				gameObject.GetComponent<Renderer> ().material.color = Color.yellow;
			//}
		}
	}
	void OnTriggerExit (Collider other) 
	{
		foreach (GameObject go in safefloor) {
		//if (other.tag == "Player") {
			gameObject.GetComponent<Renderer> ().material.color = Color.white;
		//}
		}
	}