Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Resolved FastMouse.OnStateEvent() causes massive 200ms lag

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

  1. Hannibal_Leo

    Hannibal_Leo

    Joined:
    Nov 5, 2012
    Posts:
    526
    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. Hannibal_Leo

    Hannibal_Leo

    Joined:
    Nov 5, 2012
    Posts:
    526
    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.