UNavigationSystemV1 * navSys = UNavigationSystemV1::GetCurrent(GetWorld());
if (!navSys)
return;
UNavigationPath * path = navSys->FindPathToLocationSynchronously(
GetWorld(),
GetOwner()->GetActorLocation(),
location,
GetOwner());
if (GEngine)
GEngine->AddOnScreenDebugMessage(-1, 10, FColor::Red, "NUL");
/*if (path->PathPoints.Num() <= 0)
return;*/
/*for (int32 i = 0; i < path->PathPoints.Num(); i++)
{
UKismetSystemLibrary::DrawDebugArrow(
GetWorld(),
i == 0 ? GetOwner()->GetActorLocation() : path->PathPoints[i - 1],
path->PathPoints[i],
20.0f,
FLinearColor::Green,
15.0f,
20);
}*/
It seems like navSys->FindPathToLocationSynchrounously is the one crashing but I do not know what is wrong with it. I run it this function on begin play so i can check if it calculating path correctly. please help i’ve been stuck with this for hours. I tried to dissect the code but somehow there is something wrong with FindPathToLocationSynchrounously. I also checked how other people use this.