BP Custom event not changing variable

Hi all. My custom event UnlockInteriorDoor fires but does not set the variable Boolean. I have tried with multiple variable types but none will change. If I use the custom Event Look the variable changes without issue. What am I missing?

screen shot…can’t help without it

Sorry I didn’t realise it had failed to attach. Fixed :slight_smile:

Can you post more screen shots of the logic for this whole thing to go down? Right now I can’t see where that interface is being called from, or why any of this would fire at all. Need to see the logic from start to end.

The process goes from 1 - first person character, 2 - BP_TestKey, 3 - BP_DoorInterior1

Cool. Glad you got it working.

The logic in the character BP is weird…so you have an action event that fires off a line trace, then you check if it hit something, if true you store the hit object as a variable. If no hit you set a boolean that says player is targeting object to FALSE. So far so good. Then assuming you hit something. you then check if the object hit implements an interface…ok. if it doesn’t the player isn’t targeting the right object so boolean is false again, ok, but if TRUE, you hit the right object now you check and see if “object hit equals object hit”? This will ALWAYS be true. So that branch node is unnecessary. So let’s delete that. Moving on you then ask “is player targeting object”. This will always be FALSE if any of the conditions previously were met even if the boolean is default true. Any hit on an incorrect object will make this boolean FALSE. But then it gets extra weird because you ONLY call the interface if the player is NOT targeting the correct object. Something is very wrong in that logic. Why is “player targeting object” never true? I can’t follow this. Finally it seems you are only calling the interface in the object HIT blueprint. So the interface in the door gets called, and hits that boolean about being unlocked which is always false. The interface in the KEY BP never gets called so the “unlock” event never gets called and never changes the boolean in the door BP.

Brilliant that did it. I agree the character BP was incredibly messy It was one of my first attempts at blueprints and I’ve fixed it now. The main problem I had was the interface not being called from KEY BP (Silly oversight) but thanks to your pointer it is fixed. Thanks for the help :slight_smile: