Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity's Touch API provides far fewer touches than Android OS receives (screenshot attached)

Discussion in 'Android' started by newtquestgames, Jun 30, 2016.

  1. newtquestgames

    newtquestgames

    Joined:
    Mar 9, 2015
    Posts:
    11
    Hi,

    With Android developer options I can enable Pointer Location and see all the touch points the OS receives as I slide my finger across the screen. However I've noticed that, when my game is deployed to my Android device, Unity receives far fewer touches than Android OS does; around half as many or fewer.

    In my Unity game code I use Input.touchCount and InputGetTouch() to respond to touches in my game code.

    At the moment my flick/swipe game is suffering because I receive fewer touches than are available from the OS.

    Do you know if it is possible to create an Android plugin that :

    - Responds to touch events at the OS level
    - Keeps a list of all touch events
    - Provides a list of new touch events since the last time my code asked for them ie; every Update()

    Alternatively, is there a way to access the raw OS touches from the Unity API?

    I've attached an annotated screenshot of a typical swipe showing 22 Android OS touches against 10 Unity touches. You will need to zoom in to see the Android touch points as they are single red pixels :

    Thanks
    Gareth
     

    Attached Files:

    Last edited: Jun 30, 2016
  2. rubeng

    rubeng

    Joined:
    Apr 20, 2013
    Posts:
    58
    Hi, we have also seen problems with input in unity whenever our game has a small slow down or if we need to slow it in a worse device.

    A listener solution for input as an extra would be awesome, something that allowed us to handle all input without missing any event.
     
  3. newtquestgames

    newtquestgames

    Joined:
    Mar 9, 2015
    Posts:
    11
    Hi. The problem I have is present even when there is no slow down, in a simple test scene. Unity's Touch API loses half of the touches that the Android OS gets.