Why is my HUD showing up over my main menu?

Following the “How to Create a Main Menu” tutorial as well as I can, I’ve got a functional main menu, but the HUD (which was designed and intended for the game level, not the menu level) is showing up on my main menu screen, and I can’t figure out why.

Using the World Settings, I changed my Game Mode for this level to None, so it’s now showing None for HUD Class in the Details pane:
image

Yet when I cilck Play, I suddenly have all this stuff in my world that I don’t expect or want (until the user actually clicks play, and we load the game level).
(new users only allowed one image per post)

The level blueprint does nothing but load the main menu blueprint, and show the mouse cursor. So I can’t figure out what is loading all this other stuff.
(new users only allowed one image per post)

I’m only a few weeks in to using UE4, but it’s frustrating that there are still so many mysterious things going on. Can somebody clear up this one for me?

You said the level blueprint creates the main menu, what creates the HUD? can you make the background of one of the two completely opaque and see which one is on top? This gives you a hint of which one was created first.

Also, apologies if the screenshots answer these questions, but the forum shows only the first image you linked, apparently because you’re new here.

(new users only allowed one image per post)

(That’s what it says)

“What creates the HUD?” is exactly what I’m asking! I have no idea what’s doing it.

I’m pretty sure the HUD is on top, because the main menu has a full-screen opaque background, but I’m still seeing the HUD elements.

Yeah, the screenshot limitation for new users is annoying (and seems like a poor choice if we want newbies to ask careful questions with enough detail that useful answers are possible), but oh well… I don’t think the other pictures contained the info you’re asking about (though if I understood UE well enough to be sure, I probably wouldn’t be in this pickle).

Hi Joe,

It’s hard to diagnose exactly, but my first guess would be that you are creating the HUD on a pawns blueprint, and then if that pawn is in the level you are then drawing the HUD widget.

If you can link to that tutorial I’ll take a quick look.

Yeah, there has to be a call to UUserInterface::CreateWidget<UYourHUDClass> (if you’re using C++) or the equivalent CreateWidget Blueprint node somewhere. That is assuming the HUD is a UMG widget, of course. You should search your codebase or your blueprints for that. Once you find it, the problem will probably become a lot clearer right away.

It’s hard to diagnose exactly, but my first guess would be that you are creating the HUD on a pawns blueprint, and then if that pawn is in the level you are then drawing the HUD widget.

That could be, because in addition to the HUD in the game view, I see a bunch of other stuff suddenly appearing in the World Outliner:
image

…despite the fact that in edit mode, there is literally nothing in the World Outliner except “Main (Editor) [type: World]”. But this just changes the question to: why is the rest of this junk appearing in my scene as soon as I press Play? Again, there is nothing on the level blueprint but “create main menu widget” and “show mouse cursor”.

The tutorial I’m following is this one, after doing this one.

Hey look, you can search blueprints! :slight_smile: I didn’t know that before now.
image

So it’s probably being created by the ThirdPersonCharacter blueprint. But as above, my question now simply becomes: why the heck is a ThirdPersonCharacter appearing in my main menu level, and how do I stop it?

Is there a definitive list somewhere of all the things that get loaded/run when you click “play”? In Unity, this would be: all the MonoBehaviour scripts on any objects in the default scene. But here in UE4, it seems there’s something else going on — some set of objects being instantiated by default. What defines or controls that?

Do you have a default pawn class defined in the game mode you’re using in the main menu level, for example as per step 22 in the first tutorial you linked? If so, there’s your answer. the game mode’s default pawn gets spawned every time a level starts. Off the top of my head, there are two ways to prevent that:

  1. Don’t set a default pawn or set a different pawn than the character you use during gameplay.
  2. Put a camera or a pawn in the level and have them auto possess the player. The default pawn will not spawn when the player already possesses another actor in the level.

I’m busy today so I only skimmed responses, but it looks like indeed some logic was attached to the third person character or character controller actors that are spawned into the level?

Take a look at the World Settings menu - that controls which actors get spawned by default. I dont know enough about unreal to say exactly why, but basically these default classes will be created when starting the game, and usually you’d override them with your own but if you haven’t touched them then the defaults will be present.

As mentioned earlier, for a widget to be appearing on the screen that means somewhere it is explicitly told to do so with a Create Widget and then an Add to Viewport node (assuming you are using blueprints.)

In addition to the blueprint search function, be aware of that little binocular icon on the search field. That will search through ALL blueprints.

The Game Mode automatically spawns the necessary classes that you need to run the game. If you don’t want something to spawn you can set that specific class to “None”.

Example : In this screenshot, I have set the Default Pawn Class to “None” to avoid spawning it in the Main Menu. You can change these settings in your Game Mode Blueprint

image

If you are using the same Level for both the Main Menu and the Game, instead of changing the Pawn Class (since you need it for gameplay) you can create the HUD when you click play in the Main Menu.

Thanks for all the responses, guys, but I’m still stuck. Several of you suggested looking at the Game Mode settings. But please scroll to the top — I posted a screen shot of that in my first post, showing that the GameMode is set to None, and as a result Default Pawn Class, HUD Class, etc., are all set to None.

I am not using the same level in my main menu as in the game. I have a “Main” level, which I want to contain no Pawn, HUD, player, etc. Then I have a “ThirdPersonExampleMap” which is pretty much the out-of-the-box third person content.

However poking around more, I did stumble upon this:

Here you can see in the drop-down menu that under “Project Settings”, there appears to be a UEProto1GameMode, which has various classes set on it. But you can also see (on the right) that I have attempted to override those for this level. Shouldn’t that work?

EUREKA! The clue was actually in that last screen shot above: at the end of the first menu, it says “World Override: GameMode: Not overridden!” Which was obviously not what I intended. When I tried to pick “None” from that menu, it just went back to “Not overridden!”

Apparently “None” is not a valid choice for a game mode, and when you pick that, you’re actually saying not to override the project default at all. I chose “GameModeBase” instead, and now when I run, I no longer see my HUD.

I’m still a bit confused because the World Outliner still shows a ton of auto-created objects, though. When GameModeBase is chosen, it won’t let me select any options for the default pawn class, etc., but apparently creates them anyway (?). Possibly to create a truly empty level, I would have to define my own GameModeBase subclass that refrains from creating all this extra stuff? But that sounds too advanced for me, so I guess I’ll just live with it for now.

Thank you, I had the same problem and this fixed it!

1 Like

just create a different gamemode and when in main menu level go to world settings and change the gamemode to new one with some any other character which doest have the hud on it it will overide the default gamemode in project setting