Screen.lockCursor

Hi

I have trouble applying Screen.lockCursor on startup. This will be a webbuild only, and will not have the option to go fullscreen (as the mouse only has left button and no keyboard attached).

I tried applying a function Update on the camera, but it did’nt seem to trigger it.

function Update() {
Screen.lockCursor = true;
}

I also tried with OnSceneLoaded.

Then I tried to trigger through the HTML-page with Sendmessage…

function activeCam() {document.getElementById("Unityobject").SendMessage("Main Camera", "CursorLock", "0");}

…and renamed the Unity-function to CursorLock.

Am I missing something here?

What I ultimately want it to do is to trigger the Screen.lockCursor through HTML-based javascript.

I would put it in Start(), myself, but here’s the relevant portion of the script reference: