How do I get past touch input lag?

0 favourites
  • 7 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • My problem is either incredibly simple or complex.

    I have discovered a weird input lag that applies to touch controls.

    In my game, the player can either press the Q key if on PC, or tap a button if on mobile, and if the player's stamina is 100, this action sets off a "punch" variable which temporarily sets the player's animation and movement to be punching.

    The problem is, on specifically mobile, the player is able to spam the button, and the game waits to set their stamina to 0. This problem does not exist with keyboard controls. It is pretty game-breaking, so any help is appreciated.

    Heres a video of someone doing the glitch:

    Subscribe to Construct videos now

    Heres my code:

    Tagged:

  • Try using On touched instead of On tap.

    Also you don`t need 2 separated blocks for this, as all other conditions and actions are same.

    Create a main event: On Q pressed OR On touched on Ebbuttonpunch and put all others conditions inside a sub-event.

  • Yes, "On Tap" is a gesture, it waits until the finger is lifted.

    To add to KryptoPixel's suggestions - to make an OR-block with two triggered conditions, right-click the first event, change it to OR-block, then you will be able to add "On Touch" condition to it.

  • "On Touch" has the exact same result

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The screenshot you posted isn't enough to understand the issue, and the video is 18 minutes long..

    You should definitely use "On Touch" and not "On Tap". But if you are suspecting that the stamina is still not set properly, try Debug View and Browser Log to troubleshoot.

    Does this happen when you preview on a computer and click the button with mouse, emulating the touch event?

  • Yes, this bug does occur when you click the button with the mouse.

    I've opened the debug layout and it seems as if the engine is completely ignoring the Stamina value when the button is spammed + is also not checking if the player has the "Punching" value set.

    This is weird, because this issue is not present when you spam Q on the keyboard or X on a controller, despite the code basically being the same.

  • Maybe there's some other event that is causing the issue. Like I said, your screenshot contains very little useful information. Try reproducing this bug in a smaller project and sharing it here.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)