Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

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:
    7,848
    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:
    7,848
    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:
    387
    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:
    18
    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:
    6
    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:
    19
    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.
     
  23. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    299
    I'm also using the new input system and suddenly got problems on one of my computers but not the other. Seems like the new input system does not process input events suddenly on that one. I checked the debug window and the devices send their input just fine. Tried jumping back and forth in repo history does not seem to help, neither does restarting.

    EDIT: Update of windows fixed it
     
    Last edited: Sep 27, 2019
  24. Uppset_Dave_

    Uppset_Dave_

    Joined:
    Oct 20, 2019
    Posts:
    1
    I'm having this issue still, i'm on Linux, when I run a demo in the minimised window it works fine but when I do it in a maximised window it doesn't even budge!
     
  25. centaurianmudpig

    centaurianmudpig

    Joined:
    Dec 16, 2011
    Posts:
    43
    +1 for having this issue.
     
  26. MrGreenish

    MrGreenish

    Joined:
    Oct 20, 2019
    Posts:
    13
    If you are having this issue. Have you installed a anti-key logger like Ghostpress? In that case you need to add Unity as an exception.

    Most of my keys where blocked both in edit mode and play mode but the arrow keys and the mouse could still be used.
     
  27. RealScriptGames

    RealScriptGames

    Joined:
    Aug 24, 2019
    Posts:
    1
    I think this is a Unity bug, because when I exported it as a standalone, everything was fine o_O
     
  28. DLively

    DLively

    Joined:
    Sep 6, 2015
    Posts:
    40
    I was having the same issue for a bit. I had recently imported an asset from the asset store, (Joystick Pack) and when I went to play and test out the joystick, my keyboard controls had stopped working.

    [My Solution / Error]
    I suppose While setting up my unity remote with my pc, I must have changed 'Joystick Source' from local to remote. Setting the 'Joystick Source' to Local made things work again. Project Settings -> Editor -> Joystick Source.
     
    Ghosthowl likes this.
  29. VaccionesMad

    VaccionesMad

    Joined:
    Apr 17, 2014
    Posts:
    4
    Necromancing this thread, I'm having an issue with deviced detection.

    The input system is working dandy with keyboard and mouse but now isn't picking up any events or inputs from gamepads.

    Anyone would know why? Thanks.
     
    ryzeonline likes this.
  30. ryzeonline

    ryzeonline

    Joined:
    Feb 10, 2020
    Posts:
    27
    I have similar issues to posters above.


    Input works fine in editor, game-view, maximize-on-play, etc.

    But when I run my standalone build and press a key to open my UI, suddenly all keyboard input is frozen / ignored. Would love some help or pointers in the right direction. :/
     
  31. Lz_Yahya

    Lz_Yahya

    Joined:
    Jan 24, 2020
    Posts:
    2
    Same problem here my Input.GetMouseButtonDown(0) works fine but for the keyboard input None of them work ,Any Solution Guys ??
     
  32. Lz_Yahya

    Lz_Yahya

    Joined:
    Jan 24, 2020
    Posts:
    2
    [SOLVED] Yo Guys For my Case the Problem was the UNITY REMOTE 5 when i was attached to my project i didn't get no Input from my Keyboard ,But when i detached my phone and Reopen Unity it works Really Fine.
     
  33. makhot

    makhot

    Joined:
    Dec 6, 2015
    Posts:
    1
    I was struck with the same issue when updating my project to Input System 1.0.0. Everything else (gamepad, accelerometer) seems to work but keyboard is dead.

    Input debugger shows that keyboard registers just fine, but Input System doesn't fire any events with keyboard. I tried the above window sizing tips, removing and adding keyboard again from project settings of Input System. No help.

    I noticed that if I remove keyboard bindings from Actions I cannot add them again. I couldn't be arsed to try completely deleting the Input System settings though to test if they got somehow corrupted.

    So I couldn't solve the issue and had to start using old Input Manager for keyboard, luckily I'm developing for mobile, but very annoying nevertheless.
     
  34. Zer0Cool

    Zer0Cool

    Joined:
    Oct 24, 2014
    Posts:
    141
    One possible solution:
    Check if "Time Scale" in the "Time" project settings is 0. Because then the Input class doesnt reports any player inputs.
     
  35. unity_bfvNwgs4mDhzgw

    unity_bfvNwgs4mDhzgw

    Joined:
    Apr 22, 2020
    Posts:
    2
  36. Creiz

    Creiz

    Joined:
    Jun 6, 2017
    Posts:
    58
    I got the same problem right about now, too.

    Two whole days trying to figure out what the eff I did wrong.

    I had two "Player Input" components in my scene.

    I disabled one and yeeted it out to the sun.

    Everything works perfectly.
     
unityunity