Changing the Game mode

I got a gamemode for my main menu.

I have used slate widgets to build my main menu.

When the player clicks on the new game, I want to change my game mode from the main menu gamemode and start the other game game mode.

How do I change the gamemode? Either in the HUD class or through the gamemode class.

You can set the game mode in the editor. Go to Edit->Project Settings->Maps & Modes.

No I mean to change it inside the game after the player clicks on “New Game”

There is a “GetWorld()->SetGameMode(…)” function. Whether this does what your asking I’m not sure.

EDIT: Upon further inspection, I’m not sure that’s the one. Haven’t come across the FURL before.

Then how do you do the transition from Main Menu to the start of the game?

I tend to keep it to one game mode for my projects (although I’m not sure that’s the best way to go about things). Then use the HUD class that you can set inside your gamemode and have this pop-up on game start as your main menu. Then hide the main menu when you start the game?

So, each level/map has it’s own set game mode that you can specify in the editor. What you do is have a GameMode for the main menu, and one for the game. Then, have a level/map for the Main Menu and one for the actual level. When you want to swap, run GEngine->LoadMap (or various others depending on if you are going single player or multiplayer).

When you get into the level, the gamemode will swap by itself.

The ShooterGame does this - look at how they did it there…

I’m at work, but I’ll drop back by when I get home and see if I can’t find the starting point.