So I have done as you said while also returning to adding players in PostLogin and removing them in Logout. I added these in my header file:
public:
virtual void PostLogin(APlayerController* NewPlayer) override;
virtual void Logout(AController* Exiting) override;
And these to my cpp file:
void AGameMaster::PostLogin(APlayerController* NewPlayer)
{
Super::PostLogin(NewPlayer);
Players.Add(NewPlayer);
}
void AGameMaster::Logout(AController* Exiting)
{
Super::Logout(Exiting);
APlayerController* playerController = Cast<APlayerController>(Exiting);
Players.Remove(playerController);
}
Note: Players is TArray<APlayerController*>
What happens is that my main client spawns as my custom pawn but additional clients (additional windows) do not, any idea what went wrong?