Making inventory appear/disappear using keyboard input?

I’ve been trying to make my inventory appear and disappear when i hold a keyboard input, but hopeless, does anyone have a clue on how i can do this?

You need to provide more information.

Is “your inventory” a UMG screen?

This is just one of many ways you could do it.

  1. Add an input event to a key, like “I” maybe, name it something like ToggleInput.
  2. In your player controller add a Boolean, “InventoryDisplayed”
  3. In your player controller add a reference to a Widget, call it Inventory.
  4. On your controller, get the event you made in the project settings under Input Key, get your Boolean and branch off it. If it is false, open your inventory widget and set the Boolean to true and set the ref to widget to it. If the branch was true, then call remove from parent on your reference to the Widget.

Edit: Instead of toggling on the same press, you could have 2 events, one on press and the other on release. That would give you the open while holding effect.

if youre using umg i highly suggest you look into widget switchers. it was literally made for things just like this.