Quantcast
Viewing latest article 3
Browse Latest Browse All 16

Answer by amirabiri

I found a better solution for this problem using PInvoke. This would work only on windows, but windows is the main platform that suffers from this problem I believe: #if UNITY_STANDALONE_WIN [DllImport("user32.dll")] static extern bool ClipCursor(ref RECT lpRect); public struct RECT { public int Left; public int Top; public int Right; public int Bottom; } #endif public void Start() { RECT cursorLimits; cursorLimits.Left = 0; cursorLimits.Top = 0; cursorLimits.Right = Screen.width - 1; cursorLimits.Bottom = Screen.height - 1; ClipCursor(ref cursorLimits); }

Viewing latest article 3
Browse Latest Browse All 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>