public IEnumerator Move() { _isMoving = true; AudioScript.PlayFootsteps(0); float t = 0; while (t < 1f) { t += Time.deltaTime * Speed; gameObject.transform.position = Vector3.Lerp(StartPosition, EndPosition, t); yield return(null); } _isMoving = false; yield return(0); }