IEnumerator EyeMoveScript() { eye.MoveEye(0, -20); while (eye.isMoving()) { yield return(new WaitForSeconds(0.1f)); } eye.MoveEye(20, 0); while (true) { while (eye.isMoving()) { yield return(new WaitForSeconds(0.1f)); } eye.MoveEye(-40, 0); while (eye.isMoving()) { yield return(new WaitForSeconds(0.1f)); } eye.MoveEye(40, 0); } }