I have a game where I want the player to be able to shoot by clicking or holding the left mouse button but also want them to be able to double click to auto shoot so that during long levels they don’t have to hold the mouse button so long. I have made this that works great but the problem is when they double click to stop shooting everything works fine but if they were to be in the auto shooting state and then single click it stops the shooting like it should BUT the flip flop never gets called so the next time they double click it will not shoot bc it runs the B on the flip flop. i’ve tried using a variable after the flip flop to see what state its in and then if its in the auto shooting state and someone single clicks it would just go into the flip flop but I don’t think the flip flop node likes two exec lines going into it. Sorry if this doesn’t make sense but if someone could help me id be super grateful, i’ve been looking for a workaround for a min now. Thanks
Do I understand correctly, you want to continuously fire the gun if the player double clicks the left mouse button (or whatever it assigned to fire weapon)?
I could tell you how to do that, but honestly it is bad game design, because the player will always run into situations where he “double taps” the fire button - to quickly fire two shots - and does NOT want to continue firing the weapon … leading to frustration about the weapon still firing on its own.
A much better solution would be to assign a “continuous fire” key, which the player can press to keep firing - and stop it when the player clicks the key again.
I understand what you’re saying but in this type of overhead shooter with no ammo or anything there’s really no reason to not shoot constantly so I don’t think that will be as frustrating to players as having to click another button like ctrl or whatever in the middle of trying to move and dodge. My problem is simply that if they double click and are in the auto shooting then they just click once instead of double clicking again to stop shooting the next time they double click to start auto shooting it wont work bc the flip flop node hasn’t fired. I know that I’m probably doing a bad job explaining but I hope that makes sense & thanks for whatever help you can give me
Use a branch instead a flip flop, it should work like this:
Create a boolean variable called “long shooting”.
When double click, check “long shooting” boolean, if it’s false, then start long shooting. If it’s true, then stop shooting and reset “long shooting” after the retriggerable delay.
That was the first thing I tried and I thought it made sense too but now double clicking doesn’t stop the shooting, its kind of the reverse problem from what I had before. While long shooting only single clicking stops it. I suppose its fine this was but if you have any ideas how to make it stop when single and double clicking pls let me know! thanks
For Anyone in the future I found a solution. Basically just like 4TCO said, using a variable is better BUT after the false of the variable you have to put a small delay bc if you don’t then both the true and false of the click count branch run and the double click shooting variable gets set to false always. Hope that makes sense, if not just copy this picture LOL