How To Create A Main Menu - UE4 Tutorial

Discussion in 'Game Development (Technical)' started by CodeViper, Oct 21, 2016.

  1. CodeViper

    CodeViper New Member

    Oct 21, 2016
    Likes Received:
    How To Create A Main Menu - UE4 Tutorial


    1. Create a folder to contain your UI widgets.

    2. Open that folder and create a new widget blueprint called Main Menu. (right click > User Interface > Widget Blueprint)

    3. Double click the new widget to open it up. Design the Main Menu however you like. In this tutorial, we'll create three buttons: Play, Options, Quit.

    4. Click on the "Play" button and scroll down to the bottom of the Details Panel at the right side of the screen. Click the green button beside OnClicked to target the OnClicked event. You will then be taken to the event graph with an OnClicked node.

    5. Drag off of this event and create an Open Level node. In the video tutorial, our third person level is called "World" which is the level we will open.

    6. Head back to the designer, click on the Options button and target the OnClicked event just like we did with the last button.

    7. Drag off of the event and create a Remove From Parent node.

    7. Right click in the event graph and create a Get Player Controller node. Drag off of there and add Create Widget". The widget we create is called "Options" in the video tutorial (this widget blueprint must be created and designed before we can create it here in the event graph).

    8. Connect the Remove From Player node to the Create Widget node we just added.

    9. Drag off of Create Widget and Add To Viewport. Make sure that the blue "target" value is connected to the return value of "Create Widget" so that this is what we add to the user's screen.

    10. Head back to the designer and target the OnClicked event.

    11. Drag off of the event and create a Quit Game node.

    12. Drag off of the blue, specific player value and set it to Get Player Controller.

    13. Go into the folder that containers you Levels/Maps and create a new level called MainMenu. Double click this menu to open it up.

    14. Up at the top of your screen, click Blueprints > Open Level Blueprint.

    15 . Inside of the event graph, right click and create Get Player Controller.

    15. Drag off of GPC and Create Widget. The widget is called MainMenu.

    16. Drag off of the blue return value and Add To Viewport.

    17. Connect the Create Widget node to Event Begin Play. This will add the main menu to the screen as soon as the level is loaded.

    18. In the editor, click the play button and enjoy!


    If you want to style it up a bit, you can add all sorts of content into the main menu level and it will show up in the background.

    Anyway, I hope someone finds this helpful. More tutorials are coming every week so subscribe to me on YouTube to stay updated and give me an ego boost. :cool:

    #1 CodeViper, Oct 21, 2016
    Last edited: Oct 21, 2016
    bantamcitygames likes this.
  2. bantamcitygames

    Administrator Original Member Indie Author Greenlit

    Jul 27, 2004
    Likes Received:
    @CodeViper Great stuff! Thank you for sharing with the community.
    CodeViper likes this.
  3. CodeViper

    CodeViper New Member

    Oct 21, 2016
    Likes Received:
    No problem. I'm hoping some folks find it useful.

    If anyone runs into problems or has questions then don't hesitate to leave a reply here and I'll do my best to help you out.

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer