Search Unity

Input touch delay after upgrading to 5.4

Discussion in 'Android' started by Simon_says, Aug 17, 2016.

  1. Simon_says


    Oct 19, 2013
    After I upgraded my mobile projects to Unity 5.4 I'm experiencing some weird things. Before upgrading I used version 5.3.5 and all was working fine on all devices, however now people started to complain that they have input lags. Usually this happens on low-end devices when the game just started and all assets are loading/decompressing, but this input lag happens throughout the whole game session and makes my games unplayable.

    I did some testings and it turns out that it's indeed happening since Unity 5.4 so I'm wondering if that's a bug or something has changed and my input code is wrong.

    First I used Input.GetMouseButtonDown(0) function to get input which was working fine in previous versions as well, so I thought this might be the problem and changed this line of code to this(it didn't help):
    Code (CSharp):
    2.         if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)
    3.         {
    4.             // do something
    5.         }
    6. #else
    7.         if (Input.GetMouseButtonDown(0))
    8.         {
    9.             // do something
    10.         }
    11. #endif
    A list of devices where I tested it and couldn't see this problem: Nexus 6P, Samsung Galaxy S6
    List of devices where I had input lags: Xiaomi Mi 4c, Lenovo p780

    I don't have a wide range of devices to test it, so I thought that I don't have problems on flagship devices cause of their hardware, then I turned off all cpu cores(except 1) on my 6P and downclocked my CPU, but still couldn't reproduce this issue on this device so it might be OS specific.

    Is anyone else experiencing this issues after upgrading to 5.4? I might submit a bug report but I don't know yet what would I write there, since I don't know what's the issue except "touch lags/delays". Tried to built with both Mono and il2cpp, there was no difference, and also tried multiple projects which are very optimized for mobiles and games ran 60 fps stable on devices I used for testing.