For my game I have decided to watch a few menu tutorials in order to get to grips with the basics.
To start I created a UI folder with two user interface widgets which I called Menu and options.
Then I added a horizontal box, changing the text and making sure it is aligned to where I want it on the screen.
I then added a vertical box with a size box wrapped around allowing me to align the buttons in the middle.
Here I added a button and called it play. I also changed the padding in order to space out the text from the top of the button.
I then added two more buttons as a template for the menu. The Quit button is not necessary for a mobile game, and the whole layout will most likely be changed, but for prototype purposes the layout will suffice.
This is the widget blueprint which determines what happens when a button is pressed.
The open level node allows you to say where you want the button to take you, which in this case takes you to the level.
Here is the code for the menu which connects the player controller to the menu widget, allowing them to press the buttons.
Here is the main menu up to now.
The menu as of now is at the bare basics and needs a lot more work aesthetically, along with functionality such as what buttons needs to be on there and how much space they deserve on the limited screen space. I am also having problems when I click play. When pressed the game comes on but the controls do not work, so I believe it has something to do with this code –
Still, I do not know for sure so I will continue to troubleshoot to find the problem.
I have solved the control problem by adding this code
This allows it to change from the menu controls to the game input controls solving issue of not being able to jump.