Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity mouse movement

//In 2d/UI you can move the object to your mouse position by writing this in a script and then adding it to the object you want to be at the mouse position also put it in the void update spot
transform.position = Input.mousePosition;

//or in 3d
transform.position = Camera.main.ScreenToWorldPoint(Input.mousePosition)
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity c# set object tag 
Csharp :: how to take user input in string in c# 
Csharp :: transform.rotate unity 
Csharp :: How to add a label programatically in c# 
Csharp :: how to remove raycast on a button unity 
Csharp :: unity get child 
Csharp :: c# sql duplicate key exception 
Csharp :: unity animate post processing values 
Csharp :: c# tryparse int 
Csharp :: c# class to byte array 
Csharp :: C# How to change the text colour? 
Csharp :: rotate object to mouse position unity 
Csharp :: c# mongodb connection 
Csharp :: unity making a coroutine wait until another coroutine is done 
Csharp :: parse int in c# 
Csharp :: get text component unity 
Csharp :: unity instantiate with name 
Csharp :: insert new item listview c# 
Csharp :: pyqt qtableview get selected row data 
Csharp :: c# remove spaces from string 
Csharp :: convert text to number c# 
Csharp :: how to print c# 
Csharp :: function in Razor Pages 
Csharp :: c# datagridview column size 
Csharp :: c# filter list 
Csharp :: how to make font c# 
Csharp :: 2d topdown movement unity 
Csharp :: blazor onchange event not firing with inputselect 
Csharp :: how to remove all buttons on a form C# 
Csharp :: what is public static void 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =