Answers for "unity mouse functions"

C#
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
0

unity mouse click

//Triggers when object is clicked
private void OnMouseDown()
{
  //Code to trigger
}
Posted by: Guest on January-18-2022

C# Answers by Framework

Browse Popular Code Answers by Language