You can toggle between using the mouse to move the cursor, and to free-aim, by declaring and using the "ToggleCursor" input axis (it's listed in the Settings Manager).
If you want your game to start in cursor-mode, uncheck "Lock cursor on start?" in the Settings Manager under Interface settings.
Hey, thanks for your answer. But I still have some problems.
Ingame:
What I want to achive is that the game is in first person with a locked cursor, but you can press escape on the keyboard and the menu appears with settings, resume and quit and at this point the cursor needs to be unlocked.
Under the input manager, I have set the menu button to escape, so if I press the escape key, the pause menu appears. But then the cursor is still locked in the center and I can't click anywhere.
So I set the toggle button also to escape. So I press escape, mouse gets unlocked, menu appears and I can click on options, resume, quit and so on.
The problem with this solution is, if the player click on resume game, the cursor remains unlocked, because they didn't clicked escape.
Well the easiest workaround would be to remove the resume button and force the player to play escape again, but thats ... not really what I want.
If your Pause menu has Pause game when enabled set, then the cursor should be automatically unlocked once the menu turns on - without the need for the ToggleCursor button. Are you using the latest version?
I think my problem was, that I am also using some custom code for the mouselock. It is basically working like it should, but as I am using 2 screens, it's pretty much unplayable for me, because the ingame mouse speed isnt the same as the windows mouse speed and so, my mouse get's out of the screen, even if the ingame mouse is locked.
Comments
If you want your game to start in cursor-mode, uncheck "Lock cursor on start?" in the Settings Manager under Interface settings.