title: Unity - IEnumerator's yield return null
body: <p>I'm currently trying to understand IEnumerator &amp; Coroutine within the context of Unity and am not too confident on what  the "yield return null" performs. At the moment i believe it basically pauses and waits for the next frame and in the next frame it'll go back to perform the while statement again. </p>
  
  <p>If i leave out the "yield return null" it seems the object will instantly move to its destination or perhaps "skip a lot of frames". So i guess my question is how does this "yield return null" function within this while loop and why is it necessary to have it.</p>
  
  <pre><code>void Start () {
      StartCoroutine(Move());
  }
  
  IEnumerator Move(){
  
      while (a &gt; 0.5f){
  
          ... (moves object up/down)
  
          yield return null; // &lt;---------
      }
  
      yield return new WaitForSeconds(0.5f);
  
      .... (moves object up/down)
  
      StartCoroutine(Move());
  }
  </code></pre>