I tried playing Top Down template with a (listen) server and 2 clients but clients cannot move. Then i executed Show Navigation console command and clients didnt had any nav data (green area). Is this intentional or a bug?
I used a workaround like this (Big Thanks to Omberone. Check his answer here)
TopDownNetworkTestCPPlayerController.h
UFUNCTION( reliable, server, WithValidation )
void MoveToDestination( const FVector Destination );
bool MoveToDestination_Validate( const FVector Destination );
void MoveToDestination_Implementation( const FVector Destination );
TopDownNetworkTestCPPlayerController.cpp:
bool ATopDownNetworkTestCPPlayerController::MoveToDestination_Validate( const FVector Destination )
{
return true;
}
void ATopDownNetworkTestCPPlayerController::MoveToDestination_Implementation( const FVector Destination )
{
APawn* const Pawn = GetPawn();
if (Pawn)
{
UNavigationSystem* const NavSys = UNavigationSystem::GetCurrent( this );
if (NavSys && (FVector::Dist( Destination, Pawn->GetActorLocation() ) > MIN_CLICK_DISTANCE))
{
NavSys->SimpleMoveToLocation( this, Destination );
}
}
}