Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Question New Input System, Multi-Touch behaving oddly

Discussion in 'Input System' started by ExNull-Tyelor, Jun 1, 2023.

  1. ExNull-Tyelor

    ExNull-Tyelor

    Joined:
    Apr 21, 2022
    Posts:
    24
    We're using the new Unity Input system for our game's controls, and we've gotten reports from multiple users that tapping rapidly on the left and right sides of the screen will sometimes cause the game to register a swipe instead of a tap.

    I assume this means that the "canceled" callback for our touch InputAction isn't being called, so the second tap is causing the input controller to think that the second tap is actually the first tap, but moved (i.e. swiped) to the other side of the screen.

    If the player doesn't tap extremely rapidly, this bug doesn't ever actually occur. It's only when tapping back and forth very VERY rapidly that this seems to break.

    I guess my question is if this is a fault with the new Unity Input System?

    The only solution I can really think of to fix this would be doing some kind of distance check between the touch points and determining it must be the second touch if its more than like half the screen width away from the first touch. But that just feels like a hacky, and quite edge-case prone solution.

    Ideally the new Input System I'd hope would just be smart enough to maintain order of the touches/fingers, even if the player is tapping extremely rapidly back and forth between two sides of the screen, but this doesn't seem to be the case based on our experience so far...
     
    Last edited: Jun 6, 2023