Hello folks,
I’m rather new to the Unreal, please bear with me a little.
About my problem: I’m currently implementing some kind of character creation.
- Connect using username/password as URL options from main menu widget
- ACustomGameMode::PreLogin() approves login by validating credentials
- Some widgets are created by the ACustomPlayerController(), character customisation happens.
- Widget calls ACustomPlayerController::CreateCharacter();
ACustomPlayerController.h
UFUNCTION(Server, Reliable, BlueprintCallable)
void CreateCharacter();
void ACustomPlayerController::CreateCharacter_Implementation()
{
ACustomCharacter* char = GetWorld()->SpawnActor<ACustomCharacter>(some blueprint class);
SetPawn(char);
Possess(char);
}
Now, in PIE mode, two characters are spawned.
ACustomGameMode does’n specify a DefaultPawn class, so no pawn is spawned by default.
I’ve had a closer glance at the Runtime code of UE4, and it seems like I’m doing pretty much the same the UE4 AGameMode::RestartPlayer() code would do.