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

Question Input lag on mouse and keyboard?

Discussion in 'Input System' started by agamiof, Jul 31, 2020.

  1. agamiof

    agamiof

    Joined:
    Apr 21, 2020
    Posts:
    9
    Hi,
    I'm making a fast paced FPS game and I noticed that there is some input lag, small but definitely can be felt (both in the editor and as an executable).
    I tried to move to the new input system hoping it will solve the problem but the lag exists there too. I thought it could be a screen lag so I removed all the post processing, changed to forward rendering, removed AA and vsync, lowered the quality settings, changed max queued frames to 0 - the lag is still there - so I can't be sure where it comes from.
    Does someone have an idea what causes the lag? Thanks :)
     
    Last edited: Jul 31, 2020
    chilledbits likes this.
  2. chilledbits

    chilledbits

    Joined:
    Jan 4, 2018
    Posts:
    17
    Actually I have the same problem. I tried in a completely empty project. I set the Application.targetFrameRate to 1 allowing only one update per second.
    On keyboard or mouseinput I move a gameobject by a fixed value.
    When I press a key or click the mouse the objects moves only 2 frames later (so 2 seconds).
    I couldn't figure out any solution for it yet - did you?
     
  3. agamiof

    agamiof

    Joined:
    Apr 21, 2020
    Posts:
    9
    Nothing. I tried now what you did, I see the response just in the 4th transition. The surprising thing is that the 4th frame flickers just after the 3th transition (wtf).
    My game is not supposed to be very beautiful so in order to compensate the input lag I drastically lowered the graphical settings (no post processing, no aa, no hdr, just 1 source of light). It's far from ideal, but at least it's bearable.