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 :: time.timescale 
Csharp :: blazor button onclick parameter 
Csharp :: if cluse in class in vue 
Csharp :: assign long value c# 
Csharp :: how to delay between lines in unity 
Csharp :: unity access phone camera 
Csharp :: c# datetime now timestamp 
Csharp :: .net core add header to soap request 
Csharp :: unity c# delay function 
Csharp :: how to convert int to char in c# 
Csharp :: c# read from file 
Csharp :: delete file from FTP c# 
Csharp :: key press up unity 
Csharp :: wpf scrollviewer mouse wheel 
Csharp :: remove first character in a string c# 
Csharp :: boostrap 4 modal 
Csharp :: how to play animation with code in unity 
Csharp :: c# hex to console color 
Csharp :: compare two binary tree 
Csharp :: c# list index 
Csharp :: c# how many lines in methods 
Csharp :: C# How to write Hello World 
Csharp :: write text files with C# 
Csharp :: get time from datetime c# 
Csharp :: button size xamarin 
Csharp :: c# linq select from object list 
Csharp :: unity joystick movement 2d 
Csharp :: header export excel data only php 
Csharp :: c# convert split to list 
Csharp :: how to allow user import image c# 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =