void Start() { //level = GameObject.FindGameObjectWithTag("LevelOrigin"); //print(level.name); //foreach(Transform child in level.transform) //{ // if(child.tag == "MovingPlatform") // { // print("Added Child: " + child.name); // movingPlatforms.Add(child); // } //} movingPlatforms = GameObject.FindGameObjectsWithTag("MovingPlatform"); orbs = new List <Transform>(); foreach (Transform child in transform) { if (child.tag == "Orb") { orbs.Add(child); child.gameObject.AddComponent <Orb>(); Orb script = child.gameObject.GetComponent <Orb>(); script.SetIndex(orbAmount); orbAmount++; } } }