- Home /
Screen.lockCursor for web player?
I don't think Screen.lockCursor = true;
is working when I build for web player..
Answer by jonas-echterhoff · Nov 23, 2010 at 09:55 AM
Screen.lockCursor only works after the user has clicked onto the content, to prevent abuse. If it still does not work for you, you should probably submit a bug, but we'd need more information for that, ie, a sample project, and which browser/OS you are using.
Answer by ruben_hiet · Apr 07, 2011 at 05:02 PM
hello,
I have made a game in the webplayer but I want to lock the cursor when you are playing. I added the lockCursor script from the unity reference but it doesn't work. Not one script on the internet does work.
what does work for me :
function Start(){ Screen.lockCursor = true; }
If I do that or function Awake() it locks my cursor but when I press escape it unlocks ( I want that, so it's a good thing). But when I press the button "Resume Game" with Screen.lockCursor = true; it won't work any more.
So my question is now. Does Screen.lockCursor only work in Awake or Start function and not in an OnGUI function or Update function?
Thanks in advance,
Lemon,
Your answer

Follow this Question
Related Questions
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
How to load lightmap in the webplayer 0 Answers
Chrome Web Store , Google Wallet InApp Payment (JWT ??) 1 Answer
Camera not working on webplayer like in editor 0 Answers
WebPlayer propagation 0 Answers