- Home /
Question by
Freddie_Tuke · Mar 28, 2021 at 04:04 PM ·
c#cursor
CursorLockMode.Locked doesnt work
This is my start function
private void Start()
{
Cursor.lockState = CursorLockMode.Locked;
}
it is on an active script but the cursor is not hidden nor is it locked to the centre of the screen when I play.
I'm am using Unity 2020.2.3f1
any help is appreciated
Comment
Best Answer
Answer by undevable · Mar 28, 2021 at 05:46 PM
Try making a build, and see if that fixes the problem. If that doesn't fix the problem, try:
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
Thanks! when I built it was hidden however when I added Cursor.visible = false it still would not hide in the editor.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Unity Cursor changing back 1 Answer
Why isn't Cursor.lockstate = cursorlockmode.locked; working? 1 Answer
Left Click Script Problems 1 Answer