Can't check boolean from another blueprint

So I’m making this puzzel, where the player has to find the keycard to open a passage. So when the player get the keycard a boolean is set to true. Then I need to check the boolean on the trigger box near the passage and if it’s true it shows a message that I can get in, if it’s false it says I can’t. Even though I got the keycard and the boolean should be true, when I check it on the other blueprint it always thinks it’s false.

Here’s screenshots from both blueprints:
https://prnt.sc/gha85i
https://prnt.sc/gha8dl
Here’s a gif of what happends when I play the game:

Thank you!

Hey Anzu420!

From what I’m seeing in your code, you want the bHasKey variable to be set in your character rather than the Pickup_BP. Once you’re destroying the Pickup_BP on overlap, there is no reference to the actor in your game anymore so the boolean sitting inside of the Pickup_BP is useless. I also recommend creating some form of flow control to prevent your overlap node in Pickup_BP from firing until a player has overlapped it.

(ex. On Overlap → CastToPlayer → If Succeeded → RunPickupCode → (Grab player reference and) bHasKey = True)

Just to make sure the key isn’t destroyed if something else were to hit it. If you have any AI or moveable actors in your game, they would be able to fire the overlap event and pick the key up for you.

If you need a better explanation I can provide some screenshots.

Hope this helps!

Entro