I’ve got a piece of code that is called using a custom event. A branch in between code and event controls whether or not to execute it or not. For reference i added the image below, my code is the print in the image.
Now the strange thing: The custom event pulse goes right through the branch when the bool variable is set to false… To check the branch i added a keyevent, which is properly blocked at the branch. I really need a custom event to do this, and it seems likely that it should be possible to do so?
I’m using a keyevent from my motioncontroller that goes through a FlipFlop, switching between true and false with the usual set nodes. The initial value of the bool is set to true.
A breakpoint confirms its false for the keyevent at the correct time, the custom event goes through and pauses the game even if the bool is true. It always goes through and toggles the breakpoint.
While testing i noticed that when i set the initial value of the bool to false, it works fine for the custom event as well. The problem only occurs when the initial value is true.
Initially setting the bool to false and then setting it to true on begin play also causes the problem…
A breakpoint confirms its false for the keyevent at the correct time, the custom event goes through and pauses the game even if the bool is true. It always goes through and toggles the breakpoint.
This doesn’t quite make sense. Do you mean that the custom event goes through and pauses the game, even if the bool is false?
Make sure that you’re checking the bool true/false for when the custom event in triggered, and not the keyevent. It seems like you might be accidentally setting the bool to true when you call the custom event.
Also check all instances where the bool is changed from true to false, and make sure there aren’t any unaccounted changes.