unreal-engine4game-developmenthud

How can i make main menu in unreal engine 4 blueprints


I created a fps shooter game and i want to make ui for my game (main menu) . I know i will create using widget blueprint hud's but i have an issue . I created a hud for my character it display's health , ammo, minimap , etc. and give access to FirstPersonCharacter blueprint in event begin play node but whenever i create a main menu hud and give access to the level blueprint class . Now the problem is that whenever i play it. It shows both hud's at the same time. So how can i display the menu hud first and when i play the game using a button to load a level and then it will display the second hud . Thanks in Advance


Solution

  • The way I have approached this is to have a separate Level for my Main Menu.

    I have a level called 'MainMenu' and a level called 'MainGame'

    My MainMenu level has one set of Widgets visible which contains a Start Game button. On the 'On Clicked' event for this button, it calls the 'Open Level' function node which takes the Level Name. You have to type in the level name you want to load, which is case-sensitive (very important).

    Because I have two levels, they each have their own Level Blueprint - I use these two separate level blueprints to load Widgets that are consistent only for each level.

    I also have blueprint widgets showing and hiding within a single level, for example an in-game pause menu, with an options screen. I use a button that is always visible to be able to bring up the pause menu. In my pause menu, I have an options button.

    I use various button's 'On Clicked' events in order to use the 'Set Visibility' function node. You can target a widget, and set it's Visibility to Visible or Hidden. This way, I can get several widgets to show/hide as I traverse an in-game menu.