Blueprint opening a door with key

Yeah, I think we need more details but the above posts describe the two of the three main ways I would handle this from least complex to most complex.

  1. Boolean - The player either has a key or they don’t. The player can only have one key at a time and it can open any locked door, can be removed once the door is opened or left on the player.
  2. Accumulating - The player has a number of keys. The player can open any door as long as they have at least one and one is removed when a door is opened.
  3. Unique - Each key can be used on a specific door or specific type of door.

For 1 and 2, a simple variable is needed (boolean or int). Mhousse1247’s solution can be used for either of these with a slight modification to make it accumulate keys.

For 3, you would need to implement some kind of inventory system. I would say you could make this simple or complex as well.
For a simple solution, create an array of ints. Each int represents a unique key. If a door requires key “142”, run a loop through your array searching for “142”.
For a complex solution, create an array of class “Key”. Make a “Key” blueprint containing a variable with a unique identifier (like an integer with 142). If a door requires key “142”, loop through the array getting the value of the identifier and seeing if it’s 142. The only advantage I can see over the previous method is if you wanted additional properties for the key such as a custom mesh, durability, or… other fun stuff.
You could also change the above to not be restricted to “Key” classes and accept any object reference. You can then use it as a character’s inventory system and have all sorts of stuff in there, not just keys.