private void UpdatePosition() { if (WorldSpeed) { PathPosition += (Speed / Path.Distance()) * Time.deltaTime; } else { PathPosition += Speed * Time.deltaTime; } if (Path != null) { transform.position = Path.GetPointAlongPath(PathPosition); } }