Using Screen.mouseLock

So, yeah, I’m trying to use the Screen.lockCursor script found in the docs but don’t know how. I just can’t figure out how to implement it in the game itself. Do I put it on an empty GameObject? Do I need to edit the code provided? Any help is appreciated.

you would either need to have the GUI button set up or change it to react to a keypress.