I’m trying to use my navmesh to generate a path between two arbitrary locations, then use debugspheres to visually indicate that path:
UNavigationPath *tpath;
UNavigationSystem* NavSys = UNavigationSystem::GetCurrent(GetWorld());
if (!NavSys){
return;
}
tpath = NavSys->FindPathToLocationSynchronously(GetWorld(), FVector(-410,-105,165), FVector(365,-90,165));
if (tpath != NULL)
{
for (int pointiter = 0; pointiter < tpath->PathPoints.Num(); pointiter++)
{
DrawDebugSphere(GetWorld(), tpath->PathPoints[pointiter], 10.0f, 12, FColor(255, 0, 0));
}
}
This looks correct to me, but the first line of my for loop results in an error, “use of undefined type UNavigationPath”. It’s correctly blued-in by intellisense, so I assume the system recognizes it, am I just using it in the incorrect manner?