public IEnumerator CreateWall() { GameObject[] roots = GameObject.FindGameObjectsWithTag("Root"); foreach (GameObject root in roots) { foreach (Transform child in root.transform) { if (child.gameObject.tag == "Tile") { TileScript ti = child.gameObject.GetComponent <TileScript>(); if (ti.border) { ti.MakeBorder(); } } } yield return(null); } }