Create a UI folder in My Asset folder
R click, use interface, Widget BP → name as Pause
Duplicate the BP, rename as MainMenu
Change PlayerUI from thridperson to P0 UI, place in my Asset, Player folder
Go to Player0 BP, create node “keyboard P”, Construct None created by type “create widget”, class change to Pause
Design the menu:
Open Pause Widget,
Drag Canvas box, and then Text in the graph, set Canvas box Anchors in the top middle
Type PAUSED in text block, tick size to Content, justification in the middle
Size to 100, color to red
Place the text in top middle
Drag Button and name as Unpause, sublayer drag a Text underneath, name as Unpause too
extend the button size to fit the text
Duplicate the Unpause button, rename as MainMenu
Set both button anchors in the middle, drag both button parallel to anchor ,change the 2nd button as main menu:
Activate Pause function by hitting P:
Click Graph next to Designer tab in top R corner
Delete event trick and event pre construct, make nodes as below:
Type “Set Show Mouse Cursor”
Activate Unpause and main menu button:
Click on Unpause variable at left, click On Clicked in Events (On click unpaused node is formed)
Duplicate the nodes above to connect to On click (unpaused) node, but untick paused and show mouse cursor
Continue the nodes behind as:
Create and activate Main Menu:
In My assets folder, create a new folder name as Levels → Move maps and builddata map in thirdperson Map folder into the new Levels created
R click, Level, name the new level as MainMenu
Back to Pause UI, this time on MainMenu variable, On Click (MainMenu), connect with Open Level node:
Screen cap a viewport for the main menu (go to immersive mode, turn off game mode)
Drag the screen cap shot in UI folder,
Go to MainMenu Widget, drag canvas panel and image in graph,
For image tab, select Brush, choose the screen cap
Anchor choose as entire screen, then offset left, top, right, bottom all to 0
Add background blur in canvas panel, anchor same as above, set blur strength to 4
Add also a new button name as Play, and then a text, type as Play Game
Go to Graph of main menu, delete all default nodes, create On Clicked from variable “Play”
Go to Level folder, open MainMenu Level Map → Open Level BP
In the graph, type create widget node, then choose class to mainmenu → type ”Set show mouse cursor”
Create End State:
Go to UI folder, duplicate Pause Widget, rename as EndState
Open up, change PAUSED to DEFEAT, Unpause to Retry
Go to Graph, change the On Clicked (Retry) nodes as follow:
Go to Player BP, event any damage node, add create widget at the end
Add a delay for main menu shows up after die: