Answers for "c# unity cursor show"

C#
2

cursor not visible unity c#

using UnityEngine;
using System.Collections;

public class CursorScript : MonoBehaviour
{
    // Use this for initialization
    void Start()
    {
        //Set Cursor to not be visible
        Cursor.visible = false;
    }
}
Posted by: Guest on March-27-2021
3

unity set cursor position

//C#
    // Import
    using System.Runtime.InteropServices;
    
    // Inside class
    [DllImport("user32.dll")]
    static extern bool SetCursorPos(int X, int Y);
    
    // Example
    int xPos = 30, yPos = 1000;   
    SetCursorPos(xPos,yPos);//Call this when you want to set the mouse position
Posted by: Guest on January-06-2022

C# Answers by Framework

Browse Popular Code Answers by Language