How to Make a Simple Pause Menu in Unreal Engine 5 - Beginner Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to new Unreal Engine factorial and today I'm going to show you on how to make a very simple pause menu it's going to be a very easy beautiful so let's get sorry but first check out the link in the description to get out with some unreal ending courses on winfox alright so the first thing I'm going to do is go ahead and create a new user interface widget blueprint it's gonna be a normal Digital widget it's going to be called WB underscore pause menu so this is basically going to be the UI itself and we're gonna go ahead and have all the buttons and stuff so in the palette I'm going to go ahead and search for a canvas panel and just add it into the hierarchy over here now it's for you know some reason you didn't see any of these windows you can just go into window and then open up uh the palette hierarchy Etc okay so the first thing that we're gonna go ahead and add is a vertical box so now we can just go ahead and place all the buttons that we need and it will automatically place all together you know what I mean so we're going to go ahead and kind of Center this and get the anchors just put them in corner this is just important to make sure that the uh the widget will basically in the UI will scroll rescale if we Tower the window resolution continuous and stuff so now we can just drag a bottom inside of this and then we can just rename this to be the resume button and then we're going to go ahead and let me just put the arc correctly we can just go ahead and get the text and just put it inside of the button itself and now we can spot this to be resumed and now I think that I like to do is just change a bit uh the colors of basically the the UI and stuff so the color and opacity we're gonna put them into the white and then the background color just a bit darker kind of this and there we go you can of course customize as you want the buttons and then another thing that we're gonna go ahead and do is just duplicate this buzzer and now we'll have the exit button okay and then we're gonna change the text to you know be exit and then we can go into the exit button and then just add some padding on the top so for example 35 something like that so now we have resume and exit now another thing to do even though we're not gonna implement the functionality it today we're gonna duplicate this and put in options button now I do have a tutorial and a simple options menu so I'll be basically leaving it in the description yes you want just in case you want to basically go ahead and look at it so it's going to be basically options and then again the the padding on the top is going to be 35. so now it's all nice and neat and separate from each other and a cool list over here so let's go quickly and add some functionality of the main buttons so this is one and the fastest one is going to be accessed so let's start with this one so yes select it go down into the events it's gonna be unclicked so we're gonna also delete all the other stuff we don't need that so on the collect for the exit it's a quit game and that's it we'll basically quit the game now if whatever reason you already have a pause menu and you want to sorry a main menu you want to go into that main menu you can just go ahead and open level by name just put the main menu here now I also have a main menu tutorial so I'll be linking in the description just in case you want to take a look so in my guessing is plugging quick game for the purpose this tutorial I'm gonna see quit Okay uh so now we're going to do is click the um resume button and then on clicked we want to do is put this a bit down and I'm gonna do is set game pause to be false and then basically remove from parent which is here so later on from the player we'll implement the functionality then this will basically enable and here it will basically disable Okay so now I'm also gonna select everything press C that's gonna mean resume so it's all nice neat and organized wait like I mentioned before the option menu um I'm not going to do it today because we really have to turn on that so I'll be linking it in the description okay so now let's go ahead and be able to uh open this panel from the player key now there's one more thing that I want to do into this UI and it's quickly just make it a bit prettier by just getting a blur and just putting it back in blur it's going to be just on top of the vertical box and then it's gonna be the whole anchors on the screen and all this set to zero and zero so extend in the whole screen and then the pattern is going to be something as three sorry sorry the padding no the heat booster strength it's gonna be something as three and another thing to do is get an image real quick put it right if on top of the background blur and set the anchors to be the whole screen again and put the uh offset to b0 and then we can get the tint just put it in to be more darker and then get the opacity to put it in sunlight 0.25 so now it will be a nice UI over here and a separates from the game to the buttons great and also I'm going to add a quickly to a text over here it's going to say uh pause menu real quick there we go put it over here it's gonna be a bit centered and then the font is going to be a bit bigger and now we're going to put it over here real quick and then put the anchors to be on the corners so we can rescale correctly great now we can go ahead and close it and now we're going to do is go into the third person guide to blueprint and open this up now of course you're using any other character blueprint you can go ahead and use that one so we have two ways of doing this we can just go ahead and type the Escape key or we can make a proper input action which is what we're going to do so just go into the input folder in your content example content browser go into actions and then we can go ahead and use search for input action it's going to be EA underscore pause the game and I left the capital letter over here let me see if I can change it there we go okay let's go ahead and open this and the only thing that we have to change here is trigger won't pause because the game will be pause and we want to press escape again to resume so we're gonna put that on and then we just need to go into the collection and just in the mappings we can just add a new one and then put on here the uh pause game and now it's going to be with Escape key so you can just click in here and press Escape key on your keyboard now we can go ahead and close this go into the third person's character and search for EA underscore um pause the game it's gonna be the first one with the arrow and then on started we're going to do is go ahead and create a new variable it's going to be is uh pause menu open and basically we're going to go ahead and get it and make a branch so if actually we're going to do is make a not Boolean so it will be a bit better so if it's not opened we're going to go ahead and create it so just create widget from the true the class is going to be our pause menu that we have just created the only input is going to be get player player controller there we go and then what to do is right click and promote it to our variable it's going to be our pause menu widget we just so we can delete it afterwards and then we're going to do is just add it to the viewport so we'll be in the player's screen and then I'm going to do is finally set the game to be paused over here so it's going to be true there we go and then in false actually first of all the first thing I need to do in true is actually set it to be well true because now we are a force with the many opened and in false or basically we will set it to false and then what we can do is just get the pause menu widget just drag it and get it and then remove uh from parents and then and we just go ahead and remove this over here from the screen and then we're going to do is get the game pause where I get put over here and then it's gonna be on post so now if I were to press play you will see I can play the game and I can press Escape it will pause the game and this pause menu will actually appear on the screen now I think that we I can press escape again go back to the game but the the mouse doesn't actually appear so I cannot press any of the buttons so in order to go ahead and do this what I can do is just go before we set the game to pause when we create a widget I'm gonna go ahead set the input the input mode to game and UI so the player control will be well basically this one just plug it in over here and then the in which it in Focus what we can do is get the pause menu widget and just plug it over here so now what I can do is one more thing is get the player controller again and then we can set a cursor to be set show cursor so now it will be true so now we can see the mouse and we can control it right and now what we're going to do is do the inverse um when we go ahead and close the panel so it's going to be set input mode to be game only and then the player controller will be once again the play controller let's go ahead there and then we're going to go ahead and get this to widget just plug it in here and we'll do the inverse so uh it will be false basically great um so it should be basically doing all correctly we can go ahead and press play open the game and we can go ahead and click resume and the thing that it actually didn't go back into the input mode this is because we have to also do it in the widget so if I were to go and open the widget I can just go into graph go back here and I want to do is copy this two things so set the input mode to game only get the player controller and then get the mouse so we can just go here paste it and it's got to be before we removed from the parents no if not the widget will be destroyed and we cannot do anything and then we're going to scare the play control again copy paste over here and then just go ahead and extend this so it fits everything there we go and then another thing I want to do is go from before we remove from print and quickly cast to the third person character so the object is going to be the get player character it's gonna be in the scene and then we want to set um pause menu opened to actually be false because no longer we are well with the pause menu opened so the flow of our code can continue even if we press the phone buttons or press any key so now if I were to press play press the key it will basically stop the game I have the mouse I can click buttons on top and if I press escape again I go back to the game but if I were to press resume it also goes perfectly and if I were to press Escape um sorry exit the button it will go ahead and exit the game and of course in button and sorry option doesn't do anything because we didn't implement the code but I will be linking a video in the description so that's it guys if you found this toe helpful I will really appreciate it if you could like the video and subscribe to my channel I have lots of Unreal Engine 5 tutorials on my channel so if you want to check it out go ahead and oh yes with all said bye bye foreign
Info
Channel: Gorka Games
Views: 71,851
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5, pause menu, tutorial, quixel, megascans, unreal engine tutorial, simple pause menu, ue5 pause menu, unreal engine simple pause menu widget, unreal engine 5 how to make a pause menu, unreal engine 5 make pause menu, unreal engine simple pause menu, unreal engine 5 easy pause menu, unreal engine 4 pause menu, unreal engine 4, ue4, unreal engine 5 pause menu ui, ue5 simple pause menu widget
Id: Yr8beK9FMe0
Channel Id: undefined
Length: 11min 12sec (672 seconds)
Published: Tue Dec 27 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.