Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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
 
PREVIOUS NEXT
Tagged: #unity #set #cursor #position
ADD COMMENT
Topic
Name
4+5 =