private void Update() { if (!animating) { return; } currentPath = nextPath; if (currentPath != null) { a.MoveTowardsTarget(currentPath.transform.position); } }