//to lock in the centre of window
Cursor.lockState = CursorLockMode.Locked;
//to hide the curser
Cursor.visible = false;
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
Cursor.lockState = CursorLockMode.None; // this is to lock the cursor
Cursor.visible = true; //this is to make cursor visible
using UnityEngine;
using System.Collections;
public class CursorScript : MonoBehaviour
{
// Use this for initialization
void Start()
{
//Click right mouse button to hide cursor
//Click ESC button to show curser
Cursor.lockState = CursorLockMode.Locked;
}
}
Cursor.lockState = CursorLockMode.None; // this is to unlock the cursor
Cursor.visible = true;