Search Unity

New Input System appears to have a LOT more lag than the present system

Discussion in 'Input System' started by immrATaylor, Aug 14, 2019.

  1. immrATaylor

    immrATaylor

    Joined:
    Mar 28, 2017
    Posts:
    26
    I had read on another forum post that the new system is frame rate independent. I am looking for a way to reduce input lag. I am using touch on Windows 10. Using GetTouch(0) with the current input system I am getting 20-30 ms of delay. For UI elements I am getting 70 ms. The 20-30 ms latency is acceptable for my purposes but the 70 ms is not. I am presently using the slider component in my project and I am trying to find a way to reduce the latency for UI elements as I would rather not have to go about figuring out how to remake the slider component. With the new input system, I keep getting 150-300 ms' latency. It is really really bad compared to the current system. I am toggling a GPIO pin or a board when input is registered or buttons or sliders are used and I have a program that shows the latency. Is the new system still really inefficient or am I doing something wrong? I just have the Input System UI Input module attached to the event system. For just checking touches anywhere on the screen in my scripts awake I am calling EnhancedTouchSupport.Enable();. Then I just get the touch by doing
    Code (CSharp):
    1. if (UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches.Count > 0 && TestRegTouchObjs.activeSelf == true)
    2.         {
    3.             UnityEngine.InputSystem.EnhancedTouch.Touch touch = UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches[0];
    And then doing whatever with the touch.
    I was hoping to get 30 ms or less for UI and touches. Any suggestions?
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    What's "Update Mode" in the project settings for the new input system set to? And where in the player loop does the code above sit? Just wonder whether there's something with the timestamps on the events in combination with timeslicing that makes the system defer events to later frames. Which would explain the much higher delay (and be a bug).

    The Windows touch path here isn't expected to be any slower than in the old input system. Warrants investigation.
     
    PixelFireXY likes this.
  3. immrATaylor

    immrATaylor

    Joined:
    Mar 28, 2017
    Posts:
    26
    The update mode is set to processing events in dynamic update. The code above sits in Update().In my settings I see that I also have timeslice events unchecked. My coworker that was testing it yesterday was also saying that sometimes the touch didn't seem to register at all. Below are my settings

    upload_2019-8-14_10-17-10.png
     
  4. Zalton

    Zalton

    Joined:
    Oct 2, 2013
    Posts:
    2
    Weird, I closed my asset store tab in-editor, logged out of my unity hub, closed unity all together,logged back into the unity hub, and my hiccups were gone inside the editor play window. Not sure if this may help you but it worked for me. Very odd how this would effect my editor fps but somehow it did. Seen a post a while back which pointed me in this direction. Hopefully it clears up your issues.

    https://answers.unity.com/questions/1421084/unity-editor-stuttering.html
     
    Palineto likes this.