private IEnumerator Move(Vector2 dVector) { lockPlayer(); Vector2 endLocation = transform.position + new Vector3(dVector.x, dVector.y, 0); float duration = .55f; float timeStep = 1f / 50f; Vector2 dVectorPerStep = dVector * timeStep / duration; float startTime = Time.time; while (Time.time <= startTime + duration) { transform.Translate(dVectorPerStep); yield return(new WaitForFixedUpdate()); } transform.position = endLocation; unlockPlayer(); // trigger current event BaseEvent e = GetCurrentEvent(); if (e) { e.Trigger(); } }