Why is UNavigationPath an unidentified type here?

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?

Ooh I was being a dummy, that fixes everything; thank you! :slight_smile:

try to include this in your .ccp file

#include "AI/Navigation/NavigationPath.h"

Ty! I’ll try to remember that the weirdest of runtime errors can occur from this if u try casting it to FNavigationPath lol!