[UE4]创建自定义PlayerController的方法(C++)

1 · 王爱国 · June 2, 2016, 10:15 a.m.
一种不推荐的写法: FActorSpawnParameters SpawnInfo; SpawnInfo.Instigator = Instigator; SpawnInfo.ObjectFlags |= RF_Transient; // We never want to save player controllers into a map SpawnInfo.bDeferConstruction = true; AMyPlayerController* NewPC = GetWorld()->SpawnActor<AMyPlayerController>(AMyPlayerController::StaticClass(), SpawnLocation, SpawnRotation, SpawnInfo); 参考自AGameMode::SpawnPlayerController()函数: APlayerController* AGameMode::SpawnPlayerController(ENetRole RemoteRole, FVector const& SpawnLocat...