Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to lock and hide a cursor unity

//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;
Comment

how to lock and hide the cursor unity

Cursor.lockState = CursorLockMode.None; // this is to lock the cursor
Cursor.visible = true; //this is to make cursor visible
Comment

Cursor Lock and Visible in Unity

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;
    }
}
Comment

how to lock and hide the cursor unity

Cursor.lockState = CursorLockMode.None; // this is to unlock the cursor
Cursor.visible = true;
Comment

PREVIOUS NEXT
Code Example
Csharp :: discord bot in c# 
Csharp :: c# return switch 
Csharp :: c# stop process 
Csharp :: c# convert split to list 
Csharp :: how to do time.deltatime in c# 
Csharp :: two variable in one loop c# 
Csharp :: csharp sleep code 1 second 
Csharp :: restart level unity 
Csharp :: c# bytes to image 
Csharp :: c# loop string array 
Csharp :: simple player controller unity 
Csharp :: mvc get base url 
Csharp :: c# find largest number in list 
Csharp :: https request c# 
Csharp :: if number negative c sharp 
Csharp :: add mime type for woff in web.config 
Csharp :: c# unity 
Csharp :: ienumerable count 
Csharp :: how to reference a UI element in unity 
Csharp :: c# connect tcp 
Csharp :: how to import datagridview to datatable in c# 
Csharp :: HOW TO RETURN CELL VALUE FROM EXCEL IN C# 
Csharp :: ajax asp.net core 
Csharp :: Operator Overloading | C# 
Csharp :: how to get specific length of row in matrix c# 
Csharp :: c# list 
Csharp :: get x and y of mouse uinty 
Csharp :: unity check gameobject active 
Csharp :: delete the particular line in files in c# 
Csharp :: c# how to check if a array bool is all true 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =