this:
UWorld* World = NPC->GetWorld();
if (!IsValid(World))return;
UNavigationSystemBase* NavigationSystemBase = World->GetNavigationSystem();
if (!IsValid(NavigationSystemBase))return;
UNavigationSystemV1 *NavSyste = Cast<UNavigationSystemV1>(NavigationSystemBase);
if (!IsValid(NavSyste)) return;
and this:
const FVector TargetLocation = BlackboardComponent->GetValueAsVector(Destination.SelectedKeyName);