Sunday, 16 June 2013

OnMouseDown and OnGUI seem to not be working too nicely

I have an unexpected road block; I have a 2D world with GUI objects (like buttons). I click a button, 10% of the time the OnMouseDown kinda gets stuck and, after my GUI action executes successfully, sends an OnMouseDown to the world layer and a sprite responds.


THE PROBLEM
I'm using a 2012 mac book pro, where you can lightly tap the mouse or heavily tap the mouse to obtain a mouse click. The problem seems to be linked to light clicking. 

THE SOLUTION
??

MY SOLUTION
Click properly. I guess I was "using it wrong" - sorry Apple. 

Detecting something close


I need a unit to enter a zone.

For this I have added colliders to objects. Then when they collide stuff happens.