void AGameModeBase::InitSeamlessTravelPlayer(AController* NewController) { APlayerController* NewPC = Cast<APlayerController>(NewController); // Find a start spot AActor* StartSpot = FindPlayerStart(NewController); if (StartSpot == nullptr) { UE_LOG(LogGameMode, Warning, TEXT("Could not find a starting spot")); } else { FRotator StartRotation(0, StartSpot->GetActorRotation().Yaw, 0); NewController->SetInitialLocationAndRotation(StartSpot->GetActorLocation(), StartRotation); } NewController->StartSpot = StartSpot; if (NewPC != nullptr) { NewPC->PostSeamlessTravel(); if (MustSpectate(NewPC)) { NewPC->StartSpectatingOnly(); } else { NewPC->bPlayerIsWaiting = true; NewPC->ChangeState(NAME_Spectating); NewPC->ClientGotoState(NAME_Spectating); } } }