Quantcast
Channel: Answers for "how to stop mouse going out of the screen ?"
Viewing all articles
Browse latest Browse all 16

Answer by terdos

$
0
0
As far as I know you cannot restrict the mouse from going outside the window of the application. However as stated above it is possible to lock the cursor to the center of the screen. http://unity3d.com/support/documentation/ScriptReference/Screen-lockCursor.html At this point you will have to draw your own cursor and handle your own cursor events. You can still calculate the position of the cursor using Input.GetAxis("Mouse X") and Input.GetAxis("Mouse Y") assuming they are configured in Project Settings->Input. You will likely have to detect mouse button clicks using Input.GetMouseButtonXXXX().

Viewing all articles
Browse latest Browse all 16

Trending Articles



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