IEnumerator displayWinScreen() { /* Display the whole map */ foreach (PlayerScript p in GlobalScript.getPlayers()) { if (p != null) { p.GetComponentInChildren <Camera> ().enabled = false; } } yield return(new WaitForSeconds(5)); SceneManager.LoadScene("WinScene"); }