Search Unity

Keyboard and all input suddenly stopped working?

Discussion in 'Scripting' started by Desprez, Feb 24, 2017.

  1. Desprez

    Desprez

    Joined:
    Aug 31, 2012
    Posts:
    261
    Suddenly, none of my scripts are responding to any inputs at all. Not keyboard, not mouse.
    I made a slight tweak in one script, but then changed it back. Nothing. And not all of the scripts that stopped working had been changed.

    I don't see anything obviously wrong, across multiple scenes.

    I used Debug.Log to make sure the code was executing in Update(). It is, but it's not getting any detection of input.

    I tried restarting Unity. Nothing. I don't know what happened.
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    6,511
    You're certain that the Game window is focused when you're playing?

    Can you paste the code you're using for input? It doesn't sound like it's code-based, but if you're doing something weird, it's possible.

    Have you tried creating a new project with a new script that just tests input?
     
  3. Desprez

    Desprez

    Joined:
    Aug 31, 2012
    Posts:
    261
    Yes, window is focused.

    Ok, I just tried one of the scripts in a new project.
    It works there.
     
  4. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    6,511
    So, your project got corrupted somehow. Check Edit -> Project Settings -> Input and make sure it still has all the axes/buttons set up there. If not, then I'm guessing the settings file got corrupted somehow.

    Maybe grab your new project's ProjectSettings/InputManager.asset file and copy it to your existing project folder in the same place? (close Unity while you do that just to be sure it takes)
     
  5. Desprez

    Desprez

    Joined:
    Aug 31, 2012
    Posts:
    261
    Well, it suddenly started working again. Dunno why, I didn't do anything.
     
  6. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    381
    This happens to me a fair bit - resizing the window makes it work again
     
  7. DevJim

    DevJim

    Joined:
    Dec 23, 2013
    Posts:
    25
    Just wondering if anyone found more info on this? Happens to me every hour but minimizing or resizing usually fixes it.
     
  8. CavernHead

    CavernHead

    Joined:
    Mar 30, 2017
    Posts:
    5
    Happend too me too. everything except mouse left and right click stoped working. Restarted unity and then everything went back to normal.
     
  9. bianolacerda

    bianolacerda

    Joined:
    Sep 21, 2018
    Posts:
    4
    All of a sudden, keyboard and all input stopped working here too. I can't fix it!
    Restarting doesn’t work. Neither reinstalling Unity worked.
     
  10. dohyung97022

    dohyung97022

    Joined:
    Jul 25, 2018
    Posts:
    3
    Resizing or restarting did not work, but starting by the unity made shortcut in the desktop worked. Do not open by the scenes shortcut.
     
  11. DevJim

    DevJim

    Joined:
    Dec 23, 2013
    Posts:
    25
    Still happens over here, are we all using steamworks/ the steam overlay by any chance?
     
  12. johndalzell671

    johndalzell671

    Joined:
    Oct 15, 2018
    Posts:
    3
    I am having same problem Suddenly keyboard appears dead. Is this a Unity issue or my project file? Okay so I installed an older version of the engine and opened a new project ... Still nothing!

    ... I opened new scene and tried 3d person controller and it worked fine But vehicle does not .. Purchased a new vehicle controller and it also does not work.

    Any ideas?
     
    Last edited: Nov 27, 2018
  13. DevJim

    DevJim

    Joined:
    Dec 23, 2013
    Posts:
    25
    If you hover over unity in the taskbar and wait for the window preview to appear, right click on the window preview and hit maximize. It may take one or two attempts but this generally fixes it, if it's the same issue.
     
  14. johndalzell671

    johndalzell671

    Joined:
    Oct 15, 2018
    Posts:
    3
    Didn't help. Bought the NWH vehicle physics and the demo works fine But not the prefab nor the vehicle in standard assets 2 days ago standard assets vehicle worked just fine
     
  15. bianolacerda

    bianolacerda

    Joined:
    Sep 21, 2018
    Posts:
    4
    [SOLVED] For me, it was because I had accidentally deleted Event System from Scene and Graphic Raycaster (component) from UI Canvas. By restoring those items keyboard and mouse are functioning again.
     
  16. DataSmith2112

    DataSmith2112

    Joined:
    Mar 1, 2018
    Posts:
    2
    This just happen .. Funny part is I did almost everything listed here as what may have caused it ..
    None of the advice helped sorry to say. I just made a new project and copied over my assets folder.
    A few script inputs didn't copy over to the new project. Scripts was there just not loaded in project ... Hmm.
    But I was able to run 2 Unity editors and copy over what was missing by hand. Now ... back to work!
     
  17. jandd661

    jandd661

    Joined:
    Jun 25, 2017
    Posts:
    17
    Just happened to me too. Nothing seemed to work to fix it. Had to do "Export Package" in the broken project. Then create a new project and import it. All is working again. :confused:
     
  18. devilhunterxl

    devilhunterxl

    Joined:
    Dec 19, 2018
    Posts:
    2
    Oh geez, it happens from time to time. I use Unity 2018.3.13
     
  19. abdullaa

    abdullaa

    Joined:
    Jul 4, 2019
    Posts:
    1
    Same for me, have you got any luck?
     
  20. bianolacerda

    bianolacerda

    Joined:
    Sep 21, 2018
    Posts:
    4
    Yes. See my post on Nov 20, 2018 ;)
     
  21. bianolacerda

    bianolacerda

    Joined:
    Sep 21, 2018
    Posts:
    4
    Yes. See my post on Nov 20, 2018. ;)
     
  22. fabiopicchi

    fabiopicchi

    Joined:
    Jan 22, 2016
    Posts:
    18
    The scary thing for me is that whenever the keyboard stops working inside unity, it stops working in my game already deployed to itch io. My only fix is to restart the computer hahahaha
    Gamepad seems to be working just fine though...

    On a side note, I am using the new input system.