Shooter game menu just is not there

when i press ‘play’ in the shooter game demo while i am in the shooter entry, there is no menu. am i doing somthing wrong? can someone please help?

Same problem here (in 4.8). If you start in a map and then go to the main menu, it shows fine.

I use the following simple .bat file to start the game… then it works fine. This file should be in the same directory as the shootergame uproject.

@echo off

REM Start client with uncooked content.

start “” “C:\Program Files\Epic Games\4.8\Engine\Binaries\Win64\UE4Editor.exe” “%~dp0\ShooterGame.uproject” -game -windowed -log -verbose

You need to open the MainMenu Level, by default the engine will open the Level_01 level.

If you’re in the engine and press play, it will load the map you have selected. The main menu is a different map than game maps, so you have to, under maps folder, find the main menu map (Maps->ShooterEntry), open it and then click play.
When you cook the game, it is set that the main menu map is the first to load.

thank you! i tried that, but it didnt work. -----at least in 4.7.6----- the only thing that worked for me was opening the menu after level 01 launched.

Thanks! that worked! just it wasnt .EXE because i was running it on a macbook, so it was .APP

It seems like that would work, doesnt it? in 4.7.6 it didnt quite work like that, but it does in 4.9.2! i got it to work by opening 's BAT, and by going to the menu in the editor after i hit play.

Yeah, thanks!

The main menu is visible only when you are not playing in editor. If you load the ShooterEntry level and play it from the editor you will not see any menu. This happens because the menu initialization is handled by the method ShooterGameInstance::StartGameInstance() which calls GotoInitialState(). The function StartGameInstance belongs to the GameInstance base class and is called only when playing in game, not in editor.

The first thing you can do, if you want to debug the main menu, is going to Visual Studio properties for the ShooterGame project and add in the debugging panel the command argument -game. this will ensure that when you launch the visual studio debugger, the game will start standalone using uncooked content and you will see the main menu while still being able to set breakpoints and debug the application.

If you want to see the main menu when you are playing in editor, you can add some lines of code to the project source code:

  • Add the StartPIEGameInstance method to the ShooterGameInstance class. This method will be called during a PIE (Play In Editor) game run.
  • In the StartPIEGameInstance implementation, call GotoInitialState() if the current map is ShooterEntry
  • Modify UShooterGameInstance::LoadFrontEndMap() in order to correctly check if the map that you want to load is already loaded. Here the problem comes from the fact that, during PIE, CurrentMapName will be /Game/Maps/UEDPIE_0_ShooterEntry with the UEDPIE_x_ substring added. So the method will fail to recognize that the map is already loaded and will try to load it again, causing an error.

Here is the code:

// ShooterGameInstance.h
#if WITH_EDITOR
virtual bool StartPIEGameInstance(ULocalPlayer* LocalPlayer, bool bInSimulateInEditor, bool bAnyBlueprintErrors, bool bStartInSpectatorMode) override;
#endif

// ShooterGameInstance.cpp
#if WITH_EDITOR
bool UShooterGameInstance::StartPIEGameInstance(ULocalPlayer* LocalPlayer, bool bInSimulateInEditor, bool bAnyBlueprintErrors, bool bStartInSpectatorMode) {
	Super::StartPIEGameInstanc`enter code here`e(LocalPlayer, bInSimulateInEditor, bAnyBlueprintErrors, bStartInSpectatorMode);

	UWorld* const World = GetWorld();
	if (World)
	{
		FString CurrentMapName = World->PersistentLevel->GetOutermost()->GetName();
		if(CurrentMapName.Find(TEXT("ShooterEntry")) != -1)
			GotoInitialState();
	}

	return true;
}
#endif

bool UShooterGameInstance::LoadFrontEndMap(const FString& MapName)
{
	bool bSuccess = true;

	// if already loaded, do nothing
	UWorld* const World = GetWorld();
	if (World)
	{
		FString CurrentMapName = *World->PersistentLevel->GetOutermost()->GetName();
		FString tmp = MapName.Right(MapName.Len() - FString(TEXT("/Game/Maps/")).Len());
		if (CurrentMapName.Find(tmp) != -1)
		{
			return bSuccess;
		}
	}
[...]