FindPathToActorSynchronously setting origin as first point

I’m trying to use a function that gets the UNavigationPath towards a player pawn, but the first point in the path array is always the origin of the level. I’m relatively new to UE4, so I have no idea what to do to fix this. This is the code for the function I’m trying to use:

ACharacter* playerPawn = UGameplayStatics::GetPlayerCharacter(this, 0);

UNavigationPath* navPath = UNavigationSystemV1::FindPathToActorSynchronously(this, GetActorLocation(), playerPawn);

if (navPath && navPath->PathPoints.Num() > 1) {
	// return next point
	return navPath->PathPoints[1];
}
// no path
return GetActorLocation();

The overall project compiles and works fine, it’s just the first point the AI goes to appears to be the origin of the level.

My project can’t compile,The error message is“UNavigationSystem has no member FindPathToActorSynchronously”,
This is my inclusion path:#include “NavigationSystem/Public/NavigationSystem.h”,My engine version is also 4.21,Do you know how to solve it? Thank you~