IEnumerator waitForMove() { //print ("waiting to change direction"); obstacle = true; pause = false; yield return new WaitForSeconds(4); obstacle = false; //print ("finished changing direction"); }