How can I use the "E" Key for opening doors AND pick up Items?

So my question is like written above.

I already made an IA Interact with an E key. I also got it to work to open and closing Doors. Now I wanted to make my inventory system and followed every step from the Tutorial of Ryan Laley from his Inventory System Tutorial. I’m now by Part 13 from his Tutorial.

But now I have the Problem that the “E” Key is only working for picking up Items but not anymore for opening / closing doors. I also tried to ask ChatGPT but he is talking non-sense and wants me to rebuild like everything from that what I’ve done so far so he is definitely no solution. I’m pretty new to all this developing stuff and started to learn the UE with ChatGPT.

I’m working on UE 5.7 and only with Blueprints. I can also post some Screenshots of my FirstPersonCharacter BP and my Inventory System and all that stuff if it would be helpful. But I’d really appreciate some help for how I can make it work to open/close doors AND picking up Items with the “E” Key since I need the Input Key for several things like also for interacting with NPC’s and so on.

2 Likes

Can you show the piece of code for E, both in a door and a pickup?

1 Like

Hey buddy,

You can check the thread below, where I used to have am issue with the door opening and o fi ally solved it, it contains a big part of my code that you can use and help yourself.

1 Like

Hey there @McTeppichTV! I would recommend learning about Blueprint Interfaces. They are the most effective way to cleanly manage contextual interactions like this.

This post from Clockwork sums up the resources I usually recommend plus one more that combines both:

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

1 Like

Yeah sure.

So this is my “E” Input Code for the Doors or the general “E” Interact Code. If the InputAction Interact is connected then the doors are working

This is my “E” Event Interact for the Pickup. If the “Event Interact” is connected then the Pickup system doesn’t work. Only if I connect the “InputAction Interact” but then the doors aren’t working anymore.

1 Like

I’ll check it out, thank you

I’ll check this out too, thanks

This is a fully code of an interactive Door. Idk if u meant this with showing the “E” Interaction Door Code. Maybe it’ll help too.

1 Like

Where is this code? Inside the pickup?

Yes that’s the one for Pickup / Inventory System

1 Like

If you put a print string here

Does it fire?

Are you writing a multiplayer game?

It only fires when I connect the “InputAction Interact” from the pin “pressed” with the Exc. from “Get”. While “Event Interact” is connected it doesn’t fire.

Actually I’m writing a SP Game but I didn’t found any good tutorials for an SP Inventory System. The most Tutorials are just showing very simple Inventory Systems or the Videos are like 2h on Yt. So I just built it like Ryan Laley showed it in his Tutorials. Idk if it somehow impacts the whole Coding and writing when I make a Inventory System for the MP but actually doing a SP game.

1 Like

Ok, then you’re not actually sending the interact message to the object.

I don’t know how, but if the event doesn’t fire, it’s just not getting the message.

In your player code, put a print of the actor name here

then you can check it’s picking the correct actor.

It’s picking the correct actor. My problem is just that I can’t interact with them. I made a few tests earlier with ChatGPT and the problem was that it doesn’t recognize my Inventory System. It’s recognize the Actors and all that stuff but not my Inventory System.

This below is my build for the Flashlight that the player should be able to pickup.