if (NavMesh.CalculatePath(transform.position, searchPosition, NavigationQueryFilter, path)
&& path.status == NavMeshPathStatus.PathComplete
&& path.IsPathWithinCost( MovementDistanceCost, NavigationQueryFilter))
{
The IsPathWithinCost function calculates the Cost of a path by comparing Areas Costs and distances traveled within them and compares it to a max cost to return a bool. It’s not the problem though; path.status == NavMeshPathStatus.PathComplete is coming out true and from the picture below, it’s obviously not true.
The blue cube is the location I’m searching for
The magenta line is the Path that’s returned
The white sphere is the last point in the Path. (which matches up correctly with the edge of the Unit’s NavMesh)
Location it was searching for (212.5, 0.5, 223.7)
Location of the last path.corner (215.7, 0.2, 223.1)

