if has key2 == true (on last bp schematic), then from player ref get BPC inventory and remove the item from it (pass in the key class that is assigned to unlock the door)
When I try to remove the item it removes the first item that finds in the inventory. I think that is because of the index (0) in “Remove Item” blueprint. (In this photo I dont have them connected)
I tried to connect the “Has key 1?” to index and it seems that is working but only if I have 1 key in my inventory. If I have 2 keys and I use both of them, they unlock the doors but it doesnt destroy the key2 in the inventory. Is there a way to fix this problem? I use the same code also in the other door but I change the “Has Key 1?” to “Has Key 2?”
Skip the bool all together. Save the class of key 1 and key 2 to the inventory and then just scan the inventiry if the needed keys are there and remove them.
If both keys have the same class then you need to extend the item class to have identifiers (can be strings to be more descriptive) then add key class with “1” or key class with “2”