FPathFindingQuery Unresolved External Error

Hi All,

I’m having trouble compiling the following code, since I’m getting linkage errors:

TArray<FVector> AUnitController::GetUnitPath(FAIMoveRequest const& MoveRequest)
{
	TArray<FVector> Result;
	FPathFindingQuery Query;
	FNavPathSharedPtr OutPath;
	FindPathForMoveRequest(MoveRequest, Query, OutPath);
	if (OutPath.IsValid())
	{
		for (auto Point : OutPath.Get()->GetPathPoints())
		{
			Result.Add(Point.Location);
		}
	}
	return Result;
}

I’ve added AIModule to my Build.cs file, but I’m still having compilation errors, specifically when including the FPathFindingQuery struct. Is any else having a similar problem?

Thank you.

The issue was that I had the wrong module added. I needed to add “NavigationSystem” to my *.build.cs. That fixed the compilation error. Good explanation found here
link text

1 Like