Difference between status of NavmeshAgent.CalculatePath and NavMeshAgent.pathStatus?

sorry for duplicate question of stackoverflow, But there is no answer at stackoverflow, so I would like to ask here.

I wonder why there is difference between status of NavmeshAgent.CalculatePath and pathStatus.

My agent has NavMeshAgent Component, and SetDestination target is unreachable position(the floating box).

unity project

the unity project is at GitHub - onionmk2/NavMeshAgent_pathStatus_Question

the code is …

void Awake()
{
    agent = GetComponent<NavMeshAgent>();
}

void Start()
{
    agent.SetDestination(target.position);
}

void Update()
{
    var path = new NavMeshPath();
    var hasPath = agent.CalculatePath(target.position, path);
    print("CalculatePath return: " + hasPath);
    print("path.status: " + path.status);
    print("agent.pathStatus: " + agent.pathStatus);
}

In this code, there is difference between my expectation and reality.

  • expectation

    • path by CalculatePath is PathInvalid
    • agent.pathStatus is PathInvalid
  • reality

    • path by CalculatePath is PathInvalid
    • agent.pathStatus is PathPartical

so I wolud like to know the reason why agent.pathStatus is PathPartical.

Late answer.
This is what I remember, but please verify if I’m correct.

switch (agent.pathStatus)
{
	case NavMeshPathStatus.PathComplete:
		UnityEngine.Debug.Log("Path Complete to Destination");
		break;
	case NavMeshPathStatus.PathPartial:
		UnityEngine.Debug.Log("Path Partial to Destination");
		break;
	case NavMeshPathStatus.PathInvalid:
		UnityEngine.Debug.Log("Path Invalid to Destination");
		break;
	default:
		UnityEngine.Debug.Log("break");
		break;
}