How to I press a key double times so I can make extra controls and mechanic?
Like on Minecraft where you tap W twice and it enables sprinting?
Yes that type of mechanic
You could make it so when you press a key, it will add +1 to a number and add a filter to the end of that. So when it equals 2, it will emit an output and have a third number behavior to set the 2 back to 0.
Also add a timer that starts when you press the key so after like .5 to 1 second (not sure what would work) it will reset it back to 0 as well.
That way when you press it down twice within one second, it will activate, but it won’t activate if you don’t press it twice within one second.
I think doing half a second might work a little better since you have to press a key twice pretty quickly while also having room to casually press the key without double clicking.
Ummmmm I wish I wasn’t new here so I knew what you talking about but my brain just explode so any examples???
Do you have a link to the game? I can try whipping up something and i can send you a screen shot.
Also sorry that it wasn’t that clear. Flowlab behaviors aren’t exactly the greatest to explain with words, lol.
Ok sorry for a little-late reply but here it is the link
And one more thing can you do it to all keys @ManiacPumpkin
Works for both 'Repeating" and not repeating. If you need any more help feel free to @ me, I’m always happy to help
So thats the code for double press???
Yes, if you press the button twice within whatever the time you want is, it will activate.
Ok so if I attach the do something number value and add it to y vecotiy would it double jump?@CodeAlpaca(sorry for the bother
And what do I put in the other zero or do I leave it?
(now im really sorry)
it would act as a double jump, yes. You are able to double jump again, but just add a switch to turn off when you double jump and back on when you’re on the ground.
The other zero just resets the system
So theres two switches???
Doesn’t work for repeating keys. also not resetting it after it passes through would probably cause very slight problems in most games. (example where it would not be great clicking; shooting a fireball on double key press, but if you click 3 times fast, but then the timer kicks in, meaning you would need to click 5 times to shoot 2 fireballs)