Hello, I have a question. I’m currently working on a mechanism to open a drawer. Everything was fine until I started spamming the E button, but when I did that, I encountered two issues:
The drawer gets stuck and can’t move anymore.
The drawer keeps moving further forward.
I’m using the Flip-Flop node. How can I prevent this spamming issue?
The Can Open Drawer? flag is not sufficient to control this.
You are checking this flag after the flip flop, which will therefor get out of sync when the test fails (it will still flip (or flop) even if you don’t proceed to do anything). So when you spam the key it will start (opening or closing) on the first, the second will be ignored but will still “flip” the flipflop, so the third will now be able to proceed (flag test will pass) and you will restart the open from where it got to in the mean time.
You need a Is Transitioning flag, set it true immediately before starting either timeline, and back to false after (but consider using the Finished pin from the timeline, rather than those delays). Test if Is Transitioning before the flipflop, and only proceed if false.
You can remove Can Open Drawer? flag completely and rely on the flipflop state, or remove the flipflop and replace it with a branch on that flag. Either way, make sure this is after the Is Transitioning test.
Hey there @aljag11! Welcome to the community! I agree with Silnarm when it comes to only needing one Bool, but also is there a reason you couldn’t use just the Open drawer timeline and just reverse it when it needs to close? This added complexity combined with the delays after the fact are the cause of your major headaches.