FindPathSync and errors

Windows 7 64-bit

UE 4.8.1 binary

I have derived from aPawn class wich uses my AI controller. It has only one method:

TArray<FVector> AShipAIController::SearchPath(const FVector& location)
{
	FPathFindingQuery Query;
	FAIMoveRequest MoveReq(location);

	MoveReq.SetUsePathfinding(true);

	bool bValidQuery = PreparePathfinding(MoveReq, Query);
	UNavigationSystem* NavSys = UNavigationSystem::GetCurrent(GetWorld());
	FPathFindingResult PathResult;
	TArray<FVector> Result;

	if(NavSys->IsValidLowLevel())
	{
		PathResult = NavSys->FindPathSync(Query);

		if(PathResult.Result != ENavigationQueryResult::Error)
		{
			if(PathResult.IsSuccessful() && PathResult.Path.IsValid())
			{
				for(FNavPathPoint point : PathResult.Path->GetPathPoints())
				{

					FVector tmpVector(point.Location);

					tmpVector.Z = 0.0f;
					if (!tmpVector.IsZero())
					{
						Result.Add(tmpVector);
					}
				}
			}
		}
		else
		{
			DumpToLog("Pathfinding failed", true, true, FColor::Red);
		}
	}
	else
	{
		DumpToLog("Can't find navigation system.", true, true, FColor::Red);
	}

	return Result;
}

When I’m just started UE4Editor I always have problems with pathfinding: PathResult.Result always equal to ENavigationQueryResult::Error. But if I will restart UE4Editor a few times (2 - 4) then it’s good to go. No problems.
I really confused about that.

Restarting the editor has no influence on navigation system or pathfinding, which leads me to thinking you have navmesh generation issues. I need more information to be able to help you, or a repro-project.

Cheers,

–mieszko

I think so too. But it doesn’t metter how long will I wait. Restarting game session in editor have no effect. Which information do you need? My NavMesh covering 1 plane & 2 spheres. Plane (StaticMesh’/Engine/MapTemplates/SM_Template_Map_Floor.SM_Template_Map_Floor’) size is pretty big in scale - 100x100x1. NavMesh bound volume have size: 100000.0x100000.0x200.0

Hey Alanir-

Could you post the full error message that you get when loading a project? Also a sample project that is experiencing this issue would help us investigate the cause.

Cheers

Hey Alanir-

We’ve not heard from you in a few days and I will be marking this post as resolved for tracking purposes. Feel free to post a comment if you are still having problems and we will investigate this issue further.

Cheers

Hi,

I wish I had an error message, but FindPathSync() method returns only state. There is no sample project at this moment. I think the problem somewhere in cache, because restarting the editor is the only solution.

Yes, I still have a problem.

Futhermore, if I got the problem then I can’t see navigation volume (by pressing ‘P’ key in editor).

Hey Alanir-

As Mieszko mentioned it would be best if you could provide a sample project where this is occurring for us to investigate. If possible the best case would be to recreate this in a new project and submit the new project along with the steps you took that cause this to occur. Another option would be to upload your current project to drop box, you can then send me a private message on the forums () with a link to download the project.