Attach this to an object to hide and lock the cursor on startup
public class HideCursorOnAwake : MonoBehaviour
{
private void Awake()
{
HideALockCursor();
}
public static void HideALockCursor()
{
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
}