• Godot Help
  • Is there a simple solution for a double-tap?

xyz
Awesome, simple, easy! Noted for the future.
Gotta dive into the rabbit hole of InputEvent classes someday. And measuring time using delta instead of a timer node make a whole lot more sense than my previous mess.
10/10

The thing about AI is it gets it's 'answers' by stealing other code from the internet which also means that it's going to steal all of the mistakes and nonsense answers as well.

  • xyz replied to this.

    BroTa Amazing bro! Thank you! Some of this went over my head but I'll study it so that I can internalize the info.

      Lethn The thing about AI is it gets it's 'answers' by stealing other code from the internet which also means that it's going to steal all of the mistakes and nonsense answers as well.

      From the code integrity point of view, it's worse than just stealing. It concocts snippets from statistical analysis of "stolen" code. The more specific a problem you have, the more jumbled and weird the bot's "solution" will be. That's just the nature of LLMs. And to make things worse for learners, it all looks "legit" and "confident" at first glance, regardless of how broken the code actually is. Observing this is quite amusing 🙂

        xyz Yes it is funny and ridiculous but at the same time it's not when you try and explain this to people and they get mad they can't fulfil their AI skynet apocalypse scenario, machine learning AI for the purposes that it's now popular to use it for is utter trash. Mind you, I shouldn't complain, it's going to make life so easy for me as competition because all the lazy people out there are going to switch to it thinking it can replace human thinkers when it can't.

          because posts in this forum are always about Godot by default, @GodetteAI should know this.
          she should also get context about which programming language the post is about:

          • if it's not specified anywhere, it's about GDScript
          • if it's specified in a tag, it's about the programming language in the tag
          • if it's specified in the post's body text, it's about the programing language in the body text

          Lethn I've had no luck with usable code with these current AIs, Chat GPT and Bard.
          It seems like they are more useful for explaining things. That's mostly what I've been using them for.

          Jakerb
          Glad you found it helpful.
          Although I went step by step with my answer for understanding, xyz replied with a much cleaner and simpler code.
          If you are going to internalize some code, use xyz's one.
          His solution is better because:

          • if you press any button other than A or D, for example, A F A, double A will not trigger. You can say it is not dependent on you setting keys in Input Map, and checking them manually in code.
          • No need for a timer node, time is calculated using delta of _process function, instead of using a node, which is simpler, and needs no setting up.

            BroTa I wasn't sure how to use xyz's code but I figured it out while in the middle of responding to you. That's great it's such a compact script. Thank you for your help!

            5 months later

            xyz just one thing though, if you just keep holding one button it also counts as double tap.

            • xyz replied to this.

              DarkMac just one thing though, if you just keep holding one button it also counts as double tap.

              Not if you ignore all key events that have echo property set to true.