I have a character class and a door class and am trying to make both the character do something and have the door open at the same time all by just pressing one key. I created a custom event in a game instance set a boolean to true there and then wait for that boolean to become true by calling the custom event in the character class. However, When I press the button, only the stuff in the character class happens and not in the door class.
You don’t need all that if you’re just pressing a key. Just make sure the key isn’t consuming input, and both BPs will work when you press the key:
PS: What’s up with your code is: One of the BPs only looks on begin play, the other one sets the flag when you press H. So by the time you press H, the BP that ran on begin play, is long gone…
Actually, Im having to press the button twice to make both things happen. It’s not happening at the exact same time
Did you turn off ‘consume input’ in both BPs?
Yeah, I think it’s cause Im setting a boolean by pressing H in one BP and then checking for that boolean in the other BP which also uses the H key. Is there a way to fix this and make everything happen together? The reason i need the boolean is so that I can’t open another door after opening 1.
i figured it out. i just had to change event begin play to event tick