private void SetDestination() { if (waypointsVisited > 0) { ConnectedWaypoint nextWaypoint = currentWaypoint.NextWaypoint(previousWaypoint); previousWaypoint = currentWaypoint; currentWaypoint = nextWaypoint; } Vector3 targetVector = currentWaypoint.transform.position; navMeshAgent.SetDestination(targetVector); travelling = true; }
private void SetDestination() { if (_waypointsVisited > 0) { ConnectedWaypoint nextWaypoint = _currentWaypoint.NextWaypoint(_previousWaypoint); _previousWaypoint = _currentWaypoint; _currentWaypoint = nextWaypoint; } Vector3 targetVector = _currentWaypoint.transform.position; _navMeshAgent.SetDestination(targetVector); _travelling = true; if (_travelling) { n_animator.SetBool("walking", true); } }