title: C# Coroutine doesnt works in Unity
body: <p>Im trying to make a basic platformer game and my level controller script isnt working, it needs to load loading scene first and then nextlevel but it constantly loads the nextlevel</p>
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.SceneManagement;
  
  public class LevelController : MonoBehaviour
  {
      [SerializeField] string nextLevel;
  
      private Gem[] gems;
  
      void OnEnable()
      {
          gems = FindObjectsOfType&lt;Gem&gt;();    
      }
  
      IEnumerator Wait()
      {
          yield return new WaitForSeconds(3);
      }
  
      void Update()
      {
          if (ReadyToNextLevel())
          {
              SceneManager.LoadScene(&quot;Loading&quot;);
              StartCoroutine(Wait());
              SceneManager.LoadScene(nextLevel);
          }
      }
  
      bool ReadyToNextLevel()
      {
          foreach (var gem in gems)
          {
              if (gem.gameObject.activeSelf)
              {
                  return false;
              }
          }
          return true;
      }
  
  }
  </code></pre>