Lock your cursor in Unity for Third or First person game
Oct 5, 2021
Objective: Make it so that the player cannot see the cursor when moving around the game world
This is a pretty easy thing to do. I have set mine up inside my player class as the player will always be in the scene that I would want to hide the cursor.
And that is it for locking and hiding the cursor in Unity. You set the lockState of the Cursor to be Locked. But wait, how do you unlock the cursor for using a menu? Well you change the lockMode to none.
I do this when the player presses the escape key. This allows them to move the cursor around and select items from the menu.