I can't set the Default Pawn Class

In Project Settings -> Project -> Maps and Modes, I can’t set the Default Pawn Class to anything other than DefaultPawn. It is greyed out. Is there an edit button I need to click on somewhere?

Change it in your GameMode BP instead.

It is greyed out because you have a C++ Gamemode selected.
With C++ Classes you have to define your default classes inside the code, it is not editable inside the Editor.
Because you posted it here I assume you’ll do the logic in code, therefore you have to define the default class inside the constructor of your C++ GameMode:


AYourCustomGameMode::AYourCustomGameMode()
{
    PrimaryActorTick.bCanEverTick = false;
    PrimaryActorTick.bStartWithTickEnabled = false;
    PrimaryActorTick.bAllowTickOnDedicatedServer = false;

    DefaultPawnClass = AYourCustomPawn::StaticClass();

}

If you do your logic with BP, just create a GameMode Blueprint and set it to your GameMode, thats editable inside the Editor.

2 Likes

To have the options not grayed out, you need to have a Game Mode made as Blueprint.

Two ways:

  1. If you have a Game Mode made in C++, go to the editor and create a Game Mode BP derived from it, then when you set the Game Mode BP you just created as the Game Mode in Project settings
  2. Create a new Blueprint derived from the base game mode and then set this one as Game Mode in Project settings.

Or if you want to do it all in C++ see the answer above by pDunki