Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

move object to mouse unity

//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 :: move object to mouse unity 
Csharp :: learn c# 
Csharp :: blazor button onclick parameter 
Csharp :: c# convert list to string 
Csharp :: unity vscode launch.json 
Csharp :: message uwp c# 
Csharp :: how to check if string can be converted to int c# 
Csharp :: exit programm c# 
Csharp :: c# get size of file 
Csharp :: c# string to enum 
Csharp :: list string to int c# 
Csharp :: rigidbody.addtorque 
Csharp :: bubble sort in c# 
Csharp :: public GameObject 
Csharp :: check distance to gameobject 
Csharp :: C# HttpClient POST request 
Csharp :: c# run file 
Csharp :: how to delete from a list c# 
Csharp :: c# combobox selectedvalue 
Csharp :: import time C# 
Csharp :: make invisible unity 
Csharp :: using serial port in c# 
Csharp :: custom array initializer in c# 
Csharp :: c# read binary file 
Csharp :: c# 
Csharp :: swaggergen add service not getting info in .net core 
Csharp :: mvc 5 dropdownlist 
Csharp :: c# do while loop 
Csharp :: c# if statement one line 
Csharp :: how to make panel scrollable c# 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =