Download

[UMG / BP] Troubles Hiding an Inventory Menu

Hey all,

I’ve been coming back to this issue while working on a UI/menu system for a little game I’m developing. What I want to do is show and hide an Inventory menu (which will eventually be a tabbed menu, possibly showing inv, craft, quests, etc.) using the ‘Back / Options’ button on a gamepad. So far, i can get it to display no problem, but when pressing the key again - nothing happens. Running through the debug, setting up breakpoints, I can’t pinpoint where I’m going wrong. It’s like the menu being up (boolean) isn’t registering?

Any idea what I’m missing?

UI_ShowHide.jpg

Thanks!
Gav

Try to promote a Variable of the Create Widget Output.
And use that variable as Get for the “Add to Viewport” and “Remove from Parent”.

Check if your button works with the exclusion of the pause node.
Alternate by testing “UI and game mode” node when the menu is created also.

Side note: it could be worth creating the widget and hiding the visibility of it in the event beginplay and simply setting the visibility back to visible when the button is called (with a toggle as you have already for the opposite effect of course)
Let me know what your findings are

Thanks guys!

Got it working with your help - but!

I attempted the same set up with just the variable but it seems like the problem is a combination of things, which only leads me to more questions:

Removing Pause / Unpause contributed to the fix, but now nothing is paused. I can see my controller input working in the background and, presumably, time isn’t frozen. I have read about people’s hesitations to using Pause but wasn’t really sure why. Is there an alternative, or a sort of best practice that I could do? I saw a different setup where there were 2 booleans used - basically Pause / Unpause and you flip/flop between the two. HERE

I haven’t tried making the UI visible then do the reverse system for showing it yet - only because this works for my purposes right now. Is there a benefit to doing it the opposite way, like rendering efficiency?

UI_ShowHide2.jpg

There isn’t a performance benefit to creating the menu and hiding/showing it with a button press toggle.
The reason I suggested it is because of you create a widget (menu) with a button, and then destroy it again, any settings you may use, things that have been set or changed, will revert back to default when you destroy the widget.

Its just a personal preference as opposed to sett

…Setting up a saved information system.

You could even slow down time instead of pausing which would be a great effect!

From experience, pausing the game breaks a lot of UMG control, but there are definitely ways to work around that, I just haven’t tried them

cool - thanks! Yeah, I think finding some sort of alternative is in my future. I could slow down time, but am working on crafting, inventory item switching, etc…and would want time to just stop (so no damage taken, or penalties against time, etc.)