Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Cursorhide : MonoBehaviour
- {
- // Start is called before the first frame update
- void Start()
- {
- }
- // Update is called once per frame
- void Update()
- {
- //Thanks for watching!
- //created by JaspiDiceYT
- //Also you can change the buttons to lock and unlock
- //Hides and locks cursor
- if (Input.GetKeyDown("1"))
- {
- Cursor.visible = false;
- Cursor.lockState = CursorLockMode.Locked;
- }
- //unhides and unlocks cursor
- if (Input.GetKeyDown("2"))
- {
- Cursor.visible = true;
- Cursor.lockState = CursorLockMode.None;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement