Mouse stops working in editor randomly

I’ve been consistently getting a problem where my mouse input stops working when running games in the Unity editor. It works fine at first, but about 15 - 30 mins it’ll stop working until I restart Unity.

It’s happened on multiple computers for me and happens to the default unity example files too so it’s not related to my games.

Couldn’t find anything on this forum while searching but it happens so often, I hope it’s a simple fix I’ve missed. Any ideas?

Thanks!

i sometimes notice this one… it may be a bug, seems to be related when you suddenly loss focus of the unity editor when running a game , due to a pop up or switching to another window(i use windows)… sometimes you get back your mouse, but sometimes dont, but i could not really fill a bug report as i dont know exactly what its causing it or how to recreate it… i think im gonna try to recreate it 8)

It’s happening to me very often. I haven’t noticed it being related to pop-ups, seams pretty much random so far.

Could it have anything to do with my USB mouse drivers in Windows? The again, I’ve never had any problems with them in any other program.

Ugh, I hope there’s a fix soon.

Hi, I’m having the same problem on multiple computers, one running Vista (with a PS/2 mouse), the other XP (wireless USB mouse).

I seem to be getting this problem most when editing/recompiling C# scripts. It doesn’t seem to be related to popups or the editor loosing window focus.

When this problem occurs, the mouse position (Input.mousePosition) reads the same regardless of where the mouse cursor actually is. This problem is only in the editor; if the problem occurs, and I make a build of the project, the mouse position works/updates in the executable.

I’ve searched through the forum quite a bit for any information regarding this issue, and found a few other people with the same problem, but haven’t found any solution or workaround other then restarting Unity. That’s a pretty time consuming workaround. I’ve had this problem arise literally less than one minute after starting Unity.

I’ve been hesitant about filing a bug report so far, mostly because I can’t recreate it consistantly, but also because I’m a tad lazy.

I spent approx. 45mins trying to recreate this problem on my laptop (I’m at work right now), and I couldn’t get it to happen. It might be interesting to note that I was just using the touch pad, because I don’t have access to any USB mouses (mice?) at the moment.

I too hope there is a fix soon.

It could be driver related so bug reports with the specific mice you guys are using would be much appreciated.

Okies, I’ll send a bug report off shortly. Should I still attach an example project even though I can’t reproduce it?

My specs are below. I get it it randomly. Pressing CTRL-SHIFT-P (PAUSE) twice fixes it for me every time.

It happens to me when I:

  1. Press the play button to play.
  2. Press pause
  3. Press the play button to stop.
  4. Press the play button to play.
  5. No more mouse input.

The issue seems to be the pause button. If you unpause and then press the play button to stop playing, it doesn’t happen anymore.

So…

  1. Press play to play.
  2. Press pause.
  3. Press pause to unpause.
  4. Press play to stop.
  5. Press play to play.
  6. mouse works.

The issue definitely seems to be related to the pause button. Pressing Ctrl + Shift + P twice fixes it as well.
That’s awesome guys, thanks very much PrvtHudson and NeilM!

There’s also this old bug;

If you host a game in the editor, and stop running the game in the editor. Mouse clicks are messed up, it will not properly open any editor inspector window/input whatsoever.

Starting and stopping the game mode helps (CTRL/Command+P twice). This of course only helps if you game doesn’t automatically initialise a server.

I have already properly reported this bug a good while ago.

NeilM pretty much sums how it happens for me as well :). I usually restart Unity to fix it.

I’m having the same problem. Pause/unpause works for me.

//ohm

I have this bug all the time. I reported it, and heard it’s fixed, and slated to be in the 2.5.1 release.

Untill that time, you can minimize your pain by not pressing the play button while the game is paused.
That’s what’s triggering the bug for me.

Bye, Lucas

Hey guys,

I know this is an old thread But…I am having this problem currently. It seems to consistently happen when I follow these steps:

  1. Play game
  2. Pause game
  3. Wait 30 seconds
  4. Resume game
  5. Keyboard and mouse movement are dead.

Strangely mouse click events still occur but nothing else. The only way I have found to fix the problem is to restart unity. So as you can imagine anytime I want to pause and debug something this problem becomes very annoying. The pause unpause trick above mentioned above does not work. Any workarounds or better yet a fix would be great. Thanks. Here is my info:

Unity Version: 3.3.0f4 Pro
Windows 7 32 bit

USB Logitech mouse
USB Dell Keyboard

Also if I want to report this as a bug where do I do that?

I sometimes have this same issue. I’ve actually found that if the input is frozen, add a debug log in a piece of code that deals with mouse clicks will sometimes unfreeze things.