Last active
August 29, 2015 13:57
-
-
Save poemdexter/9352481 to your computer and use it in GitHub Desktop.
Lock mouse cursor on screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Start() | |
{ | |
Screen.lockCursor = true; // lock mouse cursor on screen at start | |
} | |
void Update() | |
{ | |
if (Input.GetMouseButtonDown(0)) // keep mouse cursor locked when we come back (left click) | |
Screen.lockCursor = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment