How to Hide The Mouse Cursor in Unity

preview_player
Показать описание
In this Unity Tutorial we will hide the Mouse Cursor in Unity. This proves to be much easier by simply setting the visibility of the Mouse Cursor to false.

== LINKS ==

== CREDITS ==

== HASHTAGS ==
#kaupenjoe #unitytutorial #unity
Рекомендации по теме
Комментарии
Автор

I do the Cursor.visible = false; and it still shows nothing happens

jackgames
Автор

I have Unity on PC at home and when I lock cursor and hide it it stays locked untill i press escape and it works fine, but on other PC at work it does not stay at center of screen when i lock it, it is not even confined in game window, it just goes wherever i go with mouse, it is same on every project

icewallowcome
Автор

I get an error after I did 1:12 (Cursor.lockstate = CursorLockMode.locked;) and it says " 'Cursor' does not have a definition for lockstate'"



Code here:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HideMouse : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Cursor.visible = false;
Cursor.lockstate = CursorLockMode.Locked;
}
}

jetdragon