Answers for "how to set mouse position in unity"

C#
13

how to find the mouse position unity

Vector2 mousePosition = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
Posted by: Guest on March-12-2020
0

unity set mouse

using System.Runtime.InteropServices;
    [DllImport("user32.dll")]
    static extern bool SetCursorPos(int X, int Y);
    int xPos = 30, yPos = 1000;   
    SetCursorPos(xPos,yPos);//Call this when you want to set the mouse position
Posted by: Guest on June-16-2021

Code answers related to "how to set mouse position in unity"

C# Answers by Framework

Browse Popular Code Answers by Language