Flip flop problem

So whenever i use Flip flop, say for a light switch, or a pause menu for example, the first button click works fine and executes A, the second click executes B just fine as well, but after that starting from the third click nothing happens, and i need to click again to execute A again every time (after the first time). On the other hand B always executes just fine on one single click. So why is it that when you try to execute A after the first time it requires 2 clicks to activate? I can’t figure out how to fix this, please help.

1 Like

Can you show your code, it sounds like a problem in nearby logic…

1 Like

Here is my character and widget.

In this specific case, i’m assuming that if i resume the game using the widget button instead of the keyboard input, it doesn’t know that the game isn’t paused anymore so it’s still stuck at A and executes B when the game is already resumed?

I also tried storing whether the game is paused into a boolean and put that into a branch so when the key is pressed it’s supposed to know if the game is paused and what it should do, but it doesn’t make a difference.

1 Like

You’re making the widget with the keystroke, and then removing it with the widget button.

Next time you press the key, it does B, but there’s nothing to remove.

3rd time it does A again.

I’m assuming you also get an error about null references

1 Like

No, i don’t see any errors related to this in the logs.

Like i mentioned, i’ve tried adding a branch right after pressing the key to check if the game is currently paused or if the widget is valid, so that it only does either A or B once, but it didn’t make a difference, it always executes B even if it does nothing. I’m not sure how else to fix this besides simply removing the ability to resume using the pause key and only allow resuming with the widget button, but that’s not ideal. Is there a way to make it skip B?

Update: I think i managed to fix it by using a multigate instead, which can be reset when the widget button is used. In any case, thanks for the help once again!

2 Likes