title: Lifecycle, Coroutine and deltaTime
body: <p>Unity: 2017.3.0f3</p>
  
  <p><em>Use case : Move an object on click.</em></p>
  
  <p>I often see Coroutine like the following to move object.</p>
  
  <pre><code>private IEnumerator MoveTo(Vector2 position){
  
      while (/*stop condition*/)
      {
          float newX = speed * Time.deltaTime;
          transform.position = /*with newX*/
  
          yield return null; // &lt;-----------
      }
  
  }
  </code></pre>
  
  <p>I think it should be:</p>
  
  <pre><code>private IEnumerator MoveTo(Vector2 position){
  
      while (/*stop condition*/)
      {
          yield return null; // &lt;-----------
  
          float newX = speed * Time.deltaTime;
          transform.position = /*with newX*/
      }
  
  }
  </code></pre>
  
  <p>I think that in most use case we have to wait the next frame to execute the move action otherwise we take into account the deltaTime that already passed before we managed to move the object.</p>
  
  <p><strong>What do you think ? Am I totally wrong ?</strong></p>
  
  <p>PS: I know that we can use Update() and co. for this kind of use case.</p>