Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

New Input System touch screen lag

Discussion in 'Input System' started by MaximPP, Dec 25, 2020.

  1. MaximPP

    MaximPP

    Joined:
    Jan 26, 2019
    Posts:
    76
    I have a problem with the cursor lag on the touch screen. Here's what's shown in my video:
    1) White circle - Android system cursor label.
    2) Red square - Input.touches[0].position in the old Input System
    3) Green square - InputSystem.EnhancedTouch.Touch.activeTouches[0].screenPosition in the new Input System
    I also tried using actions, dynamic/fixed/manual update modes. Nothing helped to reduce the latency.
    Have there been any improvements on this issue in the new InputSystem?
     
  2. ZO5KmUG6R

    ZO5KmUG6R

    Joined:
    Jul 15, 2010
    Posts:
    490
    I'm also experiencing this
    As a bonus point, touch.startTime is delayed like this too, so you can't even rely on that!!! :)

    The only solution I've ever had for responsive Unity touch is NativeTouch, but IL2CPP broke that on Android.

    This issue has been present since the dawn of time it seems with Unity, somehow a third party asset can get it right, but it broke with IL2CPP

    upload_2021-12-23_22-12-3.png
    upload_2021-12-23_22-12-14.png

    Actual touch start time, as seen by Androids touch cursor: 148.559
    Unity reports Touch.startTime is 148.593
    That's 34ms of unaccounted for delay. Making it literally impossible to use this engine for any kind of application requiring responsive touch.

    The worst part is it's not even consistent! A single touch in this recording was on the mark.
    I can't even add any kind of input calibration because it's essentially random.

    upload_2021-12-23_22-15-41.png

    Unity 2020.3.21f1 LTS
    Input system 1.2.0
    Querying Touchscreen.touches[0] and saving time on Phase.Began
     
    Last edited: Dec 24, 2021
  3. ZO5KmUG6R

    ZO5KmUG6R

    Joined:
    Jul 15, 2010
    Posts:
    490
    Also tested

    - input system 1.0 (rather than 1.2)
    - onEvent instead of touchscreen.current.touches
    - polling rate of 500f

    No improvement on all three fronts.
     
  4. ZO5KmUG6R

    ZO5KmUG6R

    Joined:
    Jul 15, 2010
    Posts:
    490
    Awch. At lower framerates I'm experiencing 60-200ms delays in touch timing with EnhancedTouch.Touch.onFingerDown
    Using the .startTime from Touch still (TTime) while Time is realtimeSinceStartup
     

    Attached Files:

  5. Incole

    Incole

    Joined:
    May 5, 2018
    Posts:
    10
    It's very frustrating. I'm making non-gaming app, and if I knew about this issue before, I like be switching from Unity.

    Is Unity team even consider this an issue?