A couple of Navigation Issues

Hello, I’ve currently got two navigation issues. Firstly, I’m using the following code to test if a location is valid.

    UNavigationPath* NavPath = UNavigationSystemV1::FindPathToLocationSynchronously(GetWorld(), GetActorLocation(), location, NULL);
	if (NavPath != nullptr)
	{
		if (NavPath->IsValid() && !NavPath->IsPartial())
		{
			return true;
		}
	}

It works most of the time in that it returns FALSE if the location is inside a wall or something. However it returns TRUE in cases like the image below where the location (white marker) is off the green navmesh. This causes problems because AI cannot get to that location with AIController::MoveTo. Am I supposed to pass it NavMesh information or something so it knows how close to walls navmesh is generated, so can more accurately tell me if the location is valid?

The second problem I’m having with navigation is the function below returns false sometimes when there’s clearly valid locations within a given radius of a location.

GetRandomReachablePointInRadius
(
    const FVector & Origin,
    float Radius,
    FNavLocation & ResultLocation,
    ANavigationData * NavData,
    FSharedConstNavQueryFilter QueryFil...
)

In the image below the yellow circle is the search area. Some of the circle is on valid Navmesh and some isn’t. The function occasionally fails to find a valid location. Is it supposed to always find a random VALID point if there is one? Or just finds a random point, valid or not? And you have to test for validity yourself?

Did a bit more testing. I’m still not sure why the following returns true when the destination is off the Navmesh.

IsPartial()

However, I’ve discovered that if you get the “PathPoints” from the “UNavigationPath” object, the last point in the array is the last valid position on the Navmesh. So regardless of what “FindPathToLocationSynchronously” returns, I can just set the AI to move to the last valid position.

Has you managed to fix this problem? i have stuck on exact same issue