How to make a door open when my character picks up the key for that door

Hello I have looked at this and still am not sure on how to achieve this. I want the player to have to pick up a key that will then only open the door. My doors already open when i press e but i want them to be able to pick up a key which is placed in my level and then be able to open the door.

Cheers

In your Door’s blueprint, you can add a boolean variable called ‘Unlocked’ which is initially set to ‘False’. When the player presses ‘E’ to open the door, first you must check if ‘Unlocked’ is True. If its not, you do not open the door.

When the player picks up the Key, you find which Door that key opens (the logic for this is entirely upto you). Get a reference to that Door instance and set the variable ‘Unlocked’ to True (I would normally write a function called ‘Unlock door’ and call it instead of directly modifying the variable).

Now when you approach the door and press ‘E’, it will open

I answered a similar question elsewhere: How to use keycard to unlock door? - Programming & Scripting - Epic Developer Community Forums