How to make a toggle-able UI?

When i press ‘I’ i want a UI to open(This part i can do), but when i press ‘I’ again i want the UI to go away. How can i do this?

I’m assuming you’ll be using UMG. Just have your event go into a flip flop node. When ‘I’ is first pressed, create the UI, and store it to a variable. When it’s pressed again, use the remove from parent node to remove the UI element.

Otherwise, if you don’t want to be creating and destroying your UI every key press, you can just toggle it’s visibility by using the set visibility node, or calling an event inside your UMG to hide particular elements.

I’d also recommend taking a good look through Unreal’s youtube page, and documentation. They have some good tutorials on UI, like their inventory tutorial.

could you please provide a blueprint detailing this information. I’m trying to make it to where the widget is created when the game starts ( in the event graph of my HeroCharacter) and when I press the I key and inventory is opened, pressing the key a second time should close the inventory. I’m trying to follow the instructions you’ve provided but i cant seem to get it to work. Visuals would help me greatly, thank you so much in avance!