- Home /
Detect mouse left window
How to detect mouse left window?
Rect screenRect = new Rect(0, 0, Screen.width, Screen.height);
if (!screenRect.Contains(Input.mousePosition)) return;
Only works in Editor mode, mouse position become negative or greated than window size. In actual builded game in window mode mouse position stays in bounds although mouse cursor left window.
Comment
Answer by PixelSpartan · May 11, 2015 at 09:01 PM
Im guessing its something like OnMouseExit and OnMouseEnter...
On$$anonymous$$ouseOver / On$$anonymous$$ouseExit also only detects mouse left in Editor mode.