Created
June 30, 2018 16:23
-
-
Save dorgonman/8f4260d63ac09cde2c5fec60b346544b to your computer and use it in GitHub Desktop.
wordpress_post1583_05.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Statically bind to the specified player controller | |
UClass* PCClass = PendingLevelPlayerControllerClass; | |
// The PlayerController gets replicated from the client though the engine assumes that every Player always has | |
// a valid PlayerController so we spawn a dummy one that is going to be replaced later. | |
// | |
// Look at APlayerController::OnActorChannelOpen + UNetConnection::HandleClientPlayer for the code the | |
// replaces this fake player controller with the real replicated one from the server | |
// | |
FActorSpawnParameters SpawnInfo; | |
SpawnInfo.ObjectFlags |= RF_Transient; // We never want to save player controllers into a map | |
PlayerController = InWorld->SpawnActor<APlayerController>(PCClass, SpawnInfo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment