The GameMode defines the game's set of rules. The rules can include how players join the game, game pausing, and level transition, as well as any game-specific behavior such as win conditions. The GameMode is set for each level, and GameModes can be reused in multiple levels.
Implementation Guide
This guide covers how to create a Game Mode Blueprint and set default values for it, how to assign a Default GameMode for your game, and how to override the Default GameMode through the World Settings and GameMode Override option.
Creating a Game Mode Blueprint
The steps below will guide you in creating and setting up defaults for a Game Mode Blueprint.
This example uses the Blueprint Third Person Template; however you can use any project you wish.
In the Content Browser, click the Add (+) button.
Select Blueprint Class from the Create Basic Asset section of the dropdown menu.
You can create several different types of Blueprint Assets from the Blueprints option under Create Advanced Asset.
In the Pick Parent Class window, select the Game Mode Base Class as a Parent Class for your Blueprint Asset. This is the parent class for all Game Modes. See Parent Classes for more information.
Editing the Game Mode Defaults
Double-click on the Blueprint to open it, click the Class Defaults button to open the Blueprint Defaults in the Details panel.
Under the Game Mode are several options, that you can set as the game's default settings. Here you can assign the Character Blueprint called BP_ThirdPersonCharacter as the Default Pawn Class for players to use in the game.
The Game Mode Blueprint points to existing Blueprints of the Character, HUD, PlayerController, Spectator,Game State Classes, and so on. You will need to create these separately then specify them for use in the Game Mode Blueprint in order to actually use them in your game.
Assigning a Default Game Mode
The previous section shows you how to creat a Game Mode Blueprint. Once you have a Game Mode Blueprint, you can assign it as the Default Game Mode to use in your game. The steps below will guide you through assigning the Default Game Mode using the Project Settings option.
Navigate to the Main Toolbar of the Unreal Engine, click the Edit, then select Project Settings.
In the Project Settings window, click the Maps & Modes option.
In Maps & Modes under Default Modes, click the Default GameMode drop-down box and assign the GameMode you wish to use.
This will assign the GameMode you select as the Default Game Mode whenever the project is loaded.
If you click the arrow next to Selected GameMode, you will see the current settings used by the assigned GameMode.
Here you can see that BP_ThirdPersonCharacter is being used as the Default Pawn Class.
Overriding the Default Game Mode
When you have a Default Game Mode assigned, you can overwrite it on a per level basis in the World Settings menu under the GameMode Override section. The steps below will show you how to override the default Game Mode.
From the Main Editor Window, click the World Settings button from the Main Toolbar.
This will open the World Settings option which will appear in the bottom right window where the Details tab is located.
Inside the World Settings, under Game Mode, you can click the GameMode Override drop-down box to change the GameMode used.