Input.GetMouseButtonDown() not working

Submitted a bug report for this already, but wondering if it’s just me who’s having this problem…

Since updating to Unity 2.6, Input.GetMouseButtonDown() and related functions no longer seem to do anything.

Input.GetButtonDown(“Fire1”) where Fire1 has been bound to “mouse 0” also doesn’t do anything.

I’m currently having to press ctrl every time I’d normally click as a workaround! Anyone got any ideas?

I’m having the same problem. Anyone else?

Nope, all is fine here.

–Eric

It’s very strange. I don’t get any errors, and the Alt Positive Button (left ctrl) works just fine. I’m on win xp 64 if that makes a difference. I prefer to blame all my problems on the OS for consistency.

No mouse events work for me in 2.6 when the game is previewed in the editor. See http://forum.unity3d.com/viewtopic.php?t=35111

Ever more mysterious…
It works fine if I don’t break out the game preview window into a separate window. As soon as I pull it into it’s own window, I lose the mouse.

I’m having issues with this aswell.

If I detach my game window GetButtonDown does not detect anything, but does if I re-attach it.

Worryingly I just uploaded a test and a friend of mine could not click (although I can??) he picked up the unity web player update. He can use CTRL but not click.

He also can no longer click on a version built with 2.5?

Agggghhh

Hmm, I tried detaching the game window and it still works fine here.

–Eric

I’ve found this in intermittent. I’ve been trying to find a pattern but can’t. It’s even worked on a web-player on my PC but not when I’ve viewed it online??

Tried going to Blurst and found I had the same issue with their games.

The only consistant pattern I have is it does not work when I un-dock the game window.

I am on a 32-bit Windows XP machine. For the people also having this problem, what platform are you on? Also, anyone submit a bug report yet? Not being able to preview the game on my second monitor or at the very least in a separate window is pretty annoying.

I am on a 32 bit Windows Vista having this problem. Using IE8 with the webplayer.

Having 2 monitors and having to keep Unity all in one window is really annoying.

There was a bug report in the first post.

same here, win7 x86

Not sure about 2.6, but when I first started using 2.5, a null reference exception would cause me to lose mouse click input. :sweat_smile:

The only fix was to close and restart Unity.

I’m currently using Input.GetMouseButtonDown(0) for Mouse 0 (ie manually passing the “0” as an argument). It seems to work fine, so if you’re looking for a temporary solution that might work!

Ah, I wrote Input.GetMouseButtonDown() just to mean the method in general, my actual code for detecting left clicks is “Input.GetMouseButtonDown(0)” :slight_smile:

As has been mentioned earlier in the thread, it seems to be a problem with detaching the Game view into a separate window. I’ve since re-docked it into the main Unity window and mouse events get picked up as normal - bit of a pain but I can live with it.

Ya I have the same issue, I’m hoping this is a 2.6 thing, cause if not, there is no logical reason why its happening.

Is this happening with scripts that worked OK under 2.5? If so, can you post an example?

It’s definitely a 2.6 thing. This code worked perfectly in 2.5:

if (Input.GetButtonDown("Fire2") || (Input.GetAxis("Mouse ScrollWheel") != 0)) { 
          
//Cycle modes based on input 
         modeCycle(Input.GetAxis("Mouse ScrollWheel")); 
         if(Input.GetButtonDown("Fire2")) { 
            modeCycle(1); 
         } 
             
//Play the gun switching sound. 
         PlaySoundEffect(coreGunAttributes.switchMode, -1.0, 1.0, 0.6); 
          
}

This is a pretty huge problem. Does anyone have any idea when it might be fixed?

Confirmed on my machine using Unity 2.6. When the game window is detached, Input does not work.

This is critical issue that needs immediate attention from the Unity team.

I can also confirm this is a 2.6 problem. Made no modifications to the code. Updated from 2.5 to 2.6 and encountered this problem. Bug report submitted but no response yet.