Labels

Sunday, October 19, 2014

How to Update your Unreal Engine 4.4 UMG Menu to Work in 4.5


When I updated my project from to Unreal Engine 4.5, my Unreal Motion Graphics menu still looked alright, but the buttons no longer fired. If you followed my earlier tutorial (or set up a menu on your own in 4.4), then there is an easy fix to get your menu up and running again. This is a short tutorial on how to update your Unreal Engine 4.4 UMG Menu to 4.5.

Note: This tutorial is only relevant for readers who have already created a menu in Unreal Engine 4.4. If you have not yet created your menu, check out my tutorial on creating a menu from scratch using UMG.


1. Open up your menu widget. If you need to change the size of the text on your buttons, click each text box and navigate to Appearance > Font under the Details tab and change the value for "Size"

2. Next we need to assign events for when each button is pressed. Click on a button (not the text, but the button itself), and navigate to the "Events" heading in the Details tab. Click "Add OnClicked" and you'll be taken to the Event Graph in the Blueprint Graph part of UMG.

3. Under the "My Blueprint" tab, find the section labeled "Functions" and double click the function you created in UMG 4.4 that corresponds to the button you're working with. (So if you're adding an OnClicked for the "Play" button, double-click the "Play" function you created in 4.4).

In the graph, draw a box around the Blueprint nodes that lie between the purple function-entry and function return nodes. Right-Click and copy those two nodes. Do not copy the purple function nodes.

4. Under the "My Blueprint" tab, double-click on the EventGraph to open its tab. Press Ctrl+V to paste the blueprint nodes you just copied in step 3. Connect the OnClicked node to the nodes you just pasted. 

If you would like, draw a box around all of the nodes corresponding to that button, right click, and select the option to add a comment box around those nodes to make it easier to find them in the future.


5. Repeat steps 2 - 4 for each button in your menu. You may want to delete the old, unused functions from 4.4; they may cause errors later. Your finished product should look something like this.

That should be all you need to do to update your menu to get it working in Unreal Engine 4.5.

4 comments:

  1. Thank you for the tutorial. I have a problem with the main menu not removing itself from the viewport. When I hit play the outliner shows the loaded assets, and it will display the pause menu when I press the pause button. When I hit resume the main menu is still there. Any ideas what might be happening?

    ReplyDelete
    Replies
    1. When you initially hit the play button, does the menu ever remove itself, or does this only happen when you pause?

      Here are a few ideas for possible solutions that I've come up with:

      1. I'll assume that you have the "remove from viewport" nodes hooked up after each button is pressed, but make sure those are all hooked up in the right spots.

      2. It may be a good idea to just create a few new "remove from viewport" nodes and replace the old ones and then compile. Sometimes the nodes act weird.

      3. Check to make sure that the target on the "remove from viewport" nodes are set to the correct item. If you have your nodes hooked up in the blueprint graph of your menu widget, they should be set to "self," but if you have them somewhere else (like your level blueprint or player controller), then you need to make sure to specify the target.

      4. I never deleted the old, unused functions out of my menu widget and my menus still worked fine, but try deleting those functions (if you haven't already). There's a chance that something in there is still firing.

      Good luck. Let me know if any of that worked for you.

      Delete
  2. curious to know if this solved the problems or if you are still having troubles.

    regards,
    itsmyroad

    ReplyDelete
  3. This is what I was looking for!
    It works perfect.

    Personally, i found this tutorials clearer than the official.

    ReplyDelete