- Home /
MouseDown Hold vs Release
Is there a way to make a distinction between clicking on the screen, double clicking, and click hold/dragging?
The real issue is I have checkers, and if I single click on them, I have a script that re-centers the scene to the checkers (script is attached to the checkers). I think I can get through the ray casting myself to move and drop an object, but I can't seem to find any info on how to have the functionality to move an object (when mouse down and dragged) vs just single clicking an object to recenter the camera. I don't want the camera to recenter in the case of mouse down + drag. Double clicking could be substituted for single clicking to re-center. Right clicking will be used for a sub menu.
If someone has code for moving objects like this that won't interfere with single (or double clicking if necessary) that would be great, but otherwise any info on how to go about distinguishing between different mouse down types would be good.
JS, standalone.
Thx! Joe
Answer by Tetrad · Jun 22, 2010 at 02:33 PM
I don't have any example code, but here's a similar question: http://answers.unity3d.com/questions/12603/simultaneous-single-and-double-click-functions