Can someone explain why agents dont move without a raycasthit condition?

Ive been struggling with this for a week now, my agents seem to move fine when I have them wrapped around a conditional if statement like so

void RightClick()
    {
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, 100))
        {
            agent.SetDestination(hit.point);
        }
    }

Yet when I try to make them move without it they just refuse to move at all

public void Patrol()
    {

        //if (patrolPoints.Length == 0)
        //    return;

        //Debug.Log("REEEEEEEEEEEE");

        // Set the agent to go to the currently selected destination.
        Debug.Log(patrolPoints[currTravelpoint].position); // array of type Transform
        agent.SetDestination(patrolPoints[currTravelpoint].position);

        // Choose the next point in the array as the destination,
        // cycling to the start if necessary.
        //currTravelpoint = (currTravelpoint + 1) % patrolPoints.Length;
    }

pls, my brain not big enough to understand this, all other docs about this seem to execute it fine without the physics requirement. Enviroment and scene objects cant be at fault since the RightClick() method works without issue.

Three important questions to consider:

  • do you call the Patrol(); method properly? Do you see the Debug.Log in the console?
  • do you have a valid point in the patrolPoints[currTravelpoint].position ? Is it on the navmesh?
  • do you have any other errors in the console?

Alrighty so I updated the methods as follows

void RightClick()
    {
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        Debug.Log("RIGHT CLICK >>>>> " + Input.mousePosition);
        if (Physics.Raycast(ray, out hit, 100))
        {
            agent.SetDestination(hit.point);
        }
    }
public void Patrol()
    {

        //if (patrolPoints.Length == 0)
        //    return;

        //Debug.Log("REEEEEEEEEEEE");

        // Set the agent to go to the currently selected destination.
        Debug.Log("PATROL METHOD >>>> " + patrolPoints[currTravelpoint].position); // array of type Transform
        agent.SetDestination(patrolPoints[currTravelpoint].position);

        // Choose the next point in the array as the destination,
        // cycling to the start if necessary.
        //currTravelpoint = (currTravelpoint + 1) % patrolPoints.Length;
    }

Answer for the validity of the points on the navmesh Im sure they are valid, below are the screenshots, one for the right click and one for the patrol (executed when clicking button and left clicking on the navmesh)