Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

2d unity point at

Vector3 dir = target.position - transform.position;
 float angle = Mathf.Atan2(dir.y,dir.x) * Mathf.Rad2Deg;
 transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# difference between break and continue 
Csharp :: c# read json file into object 
Csharp :: c# get script directory 
Csharp :: random value in array c# 
Csharp :: dotnet dev-certs https --clean 
Csharp :: check if gameobject exists unity 
Csharp :: c# reverse string 
Csharp :: loop through multidimensional array c# 
Csharp :: unity c# throw exception 
Csharp :: asp.net list all files in folder 
Csharp :: move file c# 
Csharp :: shaking camera in c# 
Csharp :: c# debug console log 
Csharp :: set textbox colour to transparent c# 
Csharp :: c# application hangs while running 
Csharp :: how to create a new folder with c# 
Csharp :: db scaffolding ef core 
Csharp :: Join Or Create Room() photon 
Csharp :: hide game obj oncollisionenter 
Csharp :: .net loop through dictionary 
Csharp :: how to find avareage of an array in c# 
Csharp :: c# rename file 
Csharp :: system.linq.iorderedenumerable`2[system.char,system.char] çözümü 
Csharp :: unity deadzone 
Csharp :: C# how to ignore case 
Csharp :: .net hello world 
Csharp :: how to store user input into list c# 
Csharp :: remove items from list c# condition 
Csharp :: unity read from text file 
Csharp :: how to check if a value is inside an array c# 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =