diff --git a/Source/RWTHVRToolkit/Private/Core/RWTHVRGameModeBase.cpp b/Source/RWTHVRToolkit/Private/Core/RWTHVRGameModeBase.cpp index e2a1511392d96f9890bb52d309346d2465413593..9102b16012edc3c0c211e77fa3ec9e7f1b4f9520 100644 --- a/Source/RWTHVRToolkit/Private/Core/RWTHVRGameModeBase.cpp +++ b/Source/RWTHVRToolkit/Private/Core/RWTHVRGameModeBase.cpp @@ -143,6 +143,16 @@ void ARWTHVRGameModeBase::PostLogin(APlayerController* NewPlayer) } } + if (GetNetMode() == NM_Standalone) + { + const FName BaseName = PawnClass->HasAnyFlags(RF_ClassDefaultObject) + ? PawnClass->GetFName() + : *PawnClass->GetFName().GetPlainNameString(); + + SpawnInfo.Name = BaseName; + SpawnInfo.NameMode = FActorSpawnParameters::ESpawnActorNameMode::Requested; + } + // Spawn and possess the pawn APawn* ResultPawn = GetWorld()->SpawnActor<APawn>(PawnClass, StartSpot->GetTransform(), SpawnInfo); NewPlayer->Possess(ResultPawn);