Assign alternative pawn to first player (networked)

I’d like the first player who joins a game to be assigned a particular pawn class, and every player after that to be assigned the default pawn. Any ideas?

This did work in the editor (did not test in standalone game)

FooGameMode.h

UCLASS(minimalapi)
class AFooGameMode : public AGameMode
{
	GENERATED_BODY()

public:
	AFooGameMode();
    virtual UClass *GetDefaultPawnClassForController_Implementation(AController *InController) override;

public:
    UPROPERTY(EditDefaultsOnly)
    TSubclassOf<ACharacter> SecondClass;
};

FooGameMode.cpp

UClass*AFooGameMode::GetDefaultPawnClassForController_Implementation(AController* InController)
{
	if (NumPlayers <= 1 && SecondClass)
		return SecondClass;

	return Super::GetDefaultPawnClassForController_Implementation(InController);
}

Now in the editor create a GameMode blueprint that inherets FooGameMode and set it as default game mode.

Edit(Top Left corner)->Project Settings->Maps & Modes(Under Project on the left)

(Under Default Modes)

set Default GameMode & Global Default Server Game Mode (press the down arrow)

Thanks, that worked nicely. I ended up extending it to decide character class on login, so that the same pawn class is used for player1 when they respawn.