Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity object follow mouse

if (Input.GetMouseButton(1)) {
            mousePosition = Input.mousePosition;
            mousePosition = Camera.main.ScreenToWorldPoint(mousePosition);
            transform.position = Vector2.Lerp(transform.position, mousePosition, moveSpeed);
        }
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to write blank lines in c#.net 
Csharp :: Convert Newtonsoft.Json.Linq.JArray to type System.Collections.Generic 
Csharp :: c# get project directory 
Csharp :: sort a dictionary by value in c# 
Csharp :: c# kill all processes by name 
Csharp :: move to another scene unity 
Csharp :: double to int c# 
Csharp :: how to create a rounded custom panel c# 
Csharp :: how to set image Source in the code C# 
Csharp :: wpf set image source in code behind 
Csharp :: unity c# reference link url 
Csharp :: what is the namespace for textmesh pro 
Csharp :: Base64String to stream c# 
Csharp :: minheap c# 
Csharp :: unity button addlistener 
Csharp :: unity detect if version is a build or in editor 
Csharp :: maxheap c# 
Csharp :: validate base64 string c# 
Csharp :: unity how to end a game with esc 
Csharp :: double tryparse dot comma 
Csharp :: c#image to bytes 
Csharp :: unityWebRequest get returned data 
Csharp :: c# get bits from float 
Csharp :: pass datatable to stored procedure c# dapper 
Csharp :: unity mouse movement 
Csharp :: unity set list of strings 
Csharp :: unity hub black screen 
Csharp :: unity print name of button when click on it 
Csharp :: unity cast float to int 
Csharp :: blazor oninitializedasync 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =