Double Click inconsistencies in Mac vs PC web player

Hello all!

I have recently let a few of my friends test my ridiculously simple game via Unity web player.

The ones that test it on the mac are not able to play the game as it relies on double clicks to indicte user input.

PC users (any browser) do not have this issue and the game behaves as intended.

I am using the OnGUI method and clickCount methods to simply indicate if a double click has been recieved.

One thing to note is that if the mac users switch to full screen mode, the double click works – sort of.

The first time they have to double click it registers fine. However the next single click they make also registers as a double click. After that their next double click is correct. It continues to cycle like that.

Has anyone run into anything like this?

When I detect a double click i set a boolean to true and call a function and immediately set the boolean back to false. The function called does contain yield statements so perhaps that could be a cause?

When I get home tonight I will post my exact OnGUI to be sure but I took it directly from the Unity scripting reference.

Thanks!

L

as a follow up this has aparently been brought up before:

http://forum.unity3d.com/viewtopic.php?t=14156&highlight=event+current+clickcount

also, the exact code that is causing an issue is

if (Event.current.clickCount == 2)
    {//do things}

by changing that to

if (Event.current.isMouse  Event.current.clickCount == 2)

I can get the desired behavior on PC browsers but not Macs.

Any word on this? In searching OOLD forum posts I am seeing other problems with this.

I find it hard to believe it has gone this long without anyone taking a look?

Can anyone offer up their double click solutions or at least describe how they use clickCount successfully?

Thanks!

L

Plug at it long enough and you will figure your problem out!

I changed

		if (Event.current.clickCount == 2)
			{			
			doubleclick = true;
			}

to

		if (Event.current.clickCount == 2)
			{			
			doubleclick = true;
			}
			else 
				doubleclick = false;

I am still curious why adding Event.current.isMouse gave the same behavior with the PC but not the Mac.

Oh well, its a workaround if nothing else!

L

I spoke too soon :frowning:

The code above fixes the problem for PCs but macs still do not register a click count at all.

It works correctly on the mac if the application is full screen, but otherwise it doesnt.

Any ideas? Comments from Unity?