Search Unity

Resolved FastMouse.OnStateEvent() causes massive 200ms lag

Discussion in 'Input System' started by John_Leorid, Nov 2, 2022.

  1. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    650
    No code was changed, probably caused by a windows update.

    Of course I tried restarting my PC, restarting Unity multiple Times, re-installing the input system package. It works if there is nothing listening to any input.

    upload_2022-11-2_1-39-30.png

    and the FastMouse one:
    upload_2022-11-2_1-40-29.png

    This comes out of nowhere. Something is stacking up and I didn't change anything. Same unity version, same project, same code (atleast the code where inputs are read).

    Any idea how to fix this? (and what could be the cause?)
     
  2. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    650
    Wow, ok, that's weird. I wrote some pseudo code while chatting with a friend so I can send him a screenshot. And then I just left it there, leaving me with

    Code (CSharp):
    1. void Update()
    2. {
    3.     PlayerControls controls = new PlayerControls();
    4.     controls.Enable();
    5.     controls.Player.Jump.WasPressedThisFrame();
    6.    // ... other stuff
    7. }
    in a class that handles some other inputs.