I have another newbie question for anyone willing to help. I want to create a system that pauses the game and goes to a menu at the touch of a game pad button. When the button is pressed again, I want the menu to close (think console inventory menu). I’m able to do the first part, but I can’t seem to remove the widget at a button press. I know there’s a lot of tutorials about how to do it with a mouse - and I can do those - but it’s different with a game pad. I know there’s video tutorials about creating main menus, but they don’t really cover what I want because they use ‘event begin play’ which, to my limited knowledge, I don’t think I need. I have also seen other posts here asking the same thing, but honestly the answers use terminology that leaves me feeling a little stupid because I don’t understand it.
So please, talk to me as if I’m Jon Snow from Game of Thrones. I know nothing.
Last I check game pad in umg requires a lot of work as your basically making a state and changing it based on button press in current state.
Imagine a enum list of a basic menu pause-> opens pause menu. Commands listed 1. Un pause 2. Quit to menu 3. Quit game
When umg opens it would assume you are on resume. As menu enum would be wuick. Down button would on press switch on enum which would then set enum to quit to menu. If pressed again switch on enum to change enum to quit game.
I’m not sure what your looking for but likely you’d want to do somthing like this on a grid basis of its inventory, say 3 rows 8 collums so you can move around the grid switching based on the enum. A lot of work.
I can’t help but think UE4 would have made a similar system to ‘add widget to viewport’ with a simple change ‘remove widget from viewport’ with a reference to what widget to remove. Would have been far more straightforward XD
Well, my knowledge may be lacking, but I’m not put off by hard work
Thanks for boiling it down for me, I’ll look into the solution you suggested and hopefully wrap my head around the concept enough to get something usable. Thanks for pointing me in the right direction
Widgets can be a pain mostly depending on where you are adding them.
I highly recommend using player controller events because if you add them in say a item blue print hen they will end up belonging to the item so the item is destroyed the reference can be lost and it is then stuck on screen.
But if your event is called in controller to add the widget you can set the player admits owner and hold the reference so even if the player dies etc they still have the reference because your not removing the controller ever.
Thanks, I’ll definitely keep that in mind
I’ve had some trouble getting my head around some of the concepts of UE4, but widgets are definitely my least favourite aspect so far. They just seem needlessly complex!
Implementing Gamepad support in UE4 with your game through blueprints can take a lot of work.
here is something i have compiled for you:
First go into preferences > Input > Create a Pause input with the buttons you would like to pause the game with.
I seem to have come across a problem. I assumed all the blueprints were to go in the character event graph, but remove from parent won’t work there. I tried it under the widget’s event graph, but the bool isn’t there. Am I missing something?
Well, that fixed the boolean problem, but unfortunately it created a compilation error. 'Third Person Character does not inherit from ‘player controller’ (cast to thirdpersoncharacter will always fail) ^^;
I was using the exact same naming conventions, but neither approach seemed to be working for me. I did, however, find a solution for anyone struggling with a similar thing. Although I have still yet to turn it into a proper functional tabbed menu and inventory system, the attached blueprint will at least bring up a pause menu when pressed and close it when pressed again. Please note that on the ‘create widget’ node, a line must be pulled from return value and then promoted to a variable
Thank you for all your help, it is very much appreciated!