On Android tapping touch screen too quickly doesn't activate screen press event.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By YamiZee

This problem only happens on mobile, not on PC. If I tap the screen too quickly, only the release gets registered. For the press to get registered I have to hold the screen for some 0.3 seconds. This is an issue.

if event is InputEventScreenTouch or event is InputEventMouseButton:
    if event.pressed:
        # Takes 0.3 seconds to execute
        # No lag

Can you post more code / print statements ?

Also did u try it on different Android devices ?
Some cheap / old android are very sluggish to say the least (talking independent of Godot).

GameVisitor | 2019-03-31 11:54

:bust_in_silhouette: Reply From: YamiZee

The program was double tapping the input because I had mouse emulation on as per default settings. These resulted in 2 presses and then 2 releases. And because the code was a little slow, before the program could even advance by one frame. Due to that, all sorts of unintended things happened.

Solution was to prevent code from running twice, and I also added a remove_child before queue_free on relevant code to prevent it from being selected multiple times. Making the code faster also eliminates the problem since then you physically can’t press and release on the same frame.