1.5 - Setting the Default Game Mode

Learn how to set the default game mode for your First Person Shooter project.

On this page

Now that we've successfully extended our newly modified Game Mode to Blueprints, we'll need to set our project to use BP_FPSProjectGameMode as the default Game Mode in this step.

  1. In the Edit menu, click on Project Settings.

  2. Under the Project heading on the left side of the Project Settings tab, click on Maps & Modes.

  3. Select BP_FPSGameMode in the Default GameMode dropdown menu.


  4. Close the Project Settings menu.

  5. Click the Play button in the Level Editor Toolbar. "Hello World, this is FPSGameMode!" should now be displayed in yellow text for five seconds in the upper left hand corner of your viewport.


  6. Press the Escape key or click the Stop button in the Level Editor to exit Play in Editor (PIE) mode.

Finished Section Code


// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "GameFramework/GameModeBase.h"
#include "FPSProjectGameMode.generated.h"

class FPSPROJECT_API AFPSProjectGameMode : public AGameModeBase

    virtual void StartPlay() override;


// Fill out your copyright notice in the Description page of Project Settings.

#include "FPSProject.h"
#include "FPSProjectGameMode.h"

void AFPSProjectGameMode::StartPlay()

    if (GEngine)
        // Display a debug message for five seconds. 
        // The -1 "Key" value (first argument) indicates that we will never need to update or refresh this message.
        GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("Hello World, this is FPSGameMode!"));

Congratulations! You've learned how to:

✓ Set up a New Project
✓ Open your Project in Visual Studio
✓ Add Log Messaging to your Project
✓ Compile your First C++ Class
✓ Set the Default Game Mode

You're now ready to learn how to implement your character in the next section.

Select Skin

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback