public void GenerateLevel() { if (true) { GameObject Platform = LevelCreator.CreateNextZone(); Platform.transform.position = transform.GetChild(transform.childCount - 1).transform.position; Platform.transform.position = new Vector3(Platform.transform.position.x + 12, Platform.transform.position.y, Platform.transform.position.z); Platform.transform.SetParent(this.transform); GameObject Con = Instantiate(Connection); ; Con.transform.position = transform.GetChild(transform.childCount - 1).transform.position; Con.transform.position = new Vector3(Con.transform.position.x + 12, Con.transform.position.y, Con.transform.position.z); Con.transform.SetParent(this.transform); } }