Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity gameobject to mouse

//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 mouse movement 
Csharp :: time.timescale 
Csharp :: how to convert iformfile to byte array c# 
Csharp :: visual studio run multiple forms at once 
Csharp :: += meaning c# 
Csharp :: monodevelop ubuntu 20.04 
Csharp :: c# get all class properties 
Csharp :: c# split string for all blank character 
Csharp :: random seed in c# 
Csharp :: c# override index operator 
Csharp :: unity custom editor save changes 
Csharp :: unity print name of button when click on it 
Csharp :: unity hide in inspector 
Csharp :: string length c# 
Csharp :: transformar de string a int c# 
Csharp :: blazor oninitializedasync 
Csharp :: how to pause physics in unity c# 
Csharp :: getname of month from date c# 
Csharp :: frame time unity 
Csharp :: c# streamwriter 
Csharp :: c# initialize empty list 
Csharp :: c# create file if not exists 
Csharp :: c# socket listen on port 
Csharp :: list of string to string c# 
Csharp :: how to deselect a button through code unity 
Csharp :: convert string to int and read it 
Csharp :: unity movement 
Csharp :: c# check if string is all numbers 
Csharp :: how to clone somthing unity 
Csharp :: restart level unity 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =