public void Update() { Progressbar progressbar = GameObject.FindGameObjectWithTag("ProgressBar").GetComponent <Progressbar>(); //if all teams are ready if (progressbar.allTeamsReady() && noTopicsSet) { setTopics(); noTopicsSet = false; } }