title: Wait inbetween functions in Unity3D
body: <p>I want to wait 2 seconds between the <code>Start()</code> and the <code>Update()</code> function, my code:</p>
  
  <pre><code>void Start () {
          r = GetComponent&lt;RobotController&gt;();
          r.postEffectroPos(new Vector3(0.2f, 0.0f, 0.3f), 0.1f);
          StartCoroutine(wait2Sec());
      }
  </code></pre>
  
  <p>My wait function:</p>
  
  <pre><code>IEnumerator wait2Sec() {
          yield return new WaitForSeconds(2.0f);
          Debug.Log("Robot is moving to start position");
      }
  </code></pre>
  
  <p>In Update():</p>
  
  <pre><code>if (controlRobot)
          {
              moveRobot();
              movePlayerToRobot();
          }
  </code></pre>
  
  <p>I want to move my robot at the start to a set position and then enable the movement of the robot. The problem is that <code>moveRobot()</code> gets the current position of the robot and posts a call with an adjusted position depending on the input.</p>
  
  <p>So the robot does not wait in the <code>Update()</code> function for the <code>Start()</code> function to finish the 2 seconds.</p>