I need to lock my mouse in the middle of my screen, kind of like fall out 3 style. Can anyone help. I've already tried. And it doesn't work.
Screen.lockCursor = true;
I need to lock my mouse in the middle of my screen, kind of like fall out 3 style. Can anyone help. I've already tried. And it doesn't work.
Screen.lockCursor = true;
It works for me:
void Update()
{
if (Input.GetKey(KeyCode.Space))
Screen.lockCursor = true;
else
Screen.lockCursor = false;
}
"In the web player the cursor may only only be locked after the user has clicked on the content and the user has not left the content view with the cursor"
More @ http://unity3d.com/support/documentation/ScriptReference/Screen-lockCursor.html