Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

get 2d rotation from 2 position math

Vector3 dir = new Vector3(position2.x - position1.x, position2.y - position1.y);
float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
Quaternion rotation = Quaternion.Euler( 0f, 0f, angle );
Comment

PREVIOUS NEXT
Code Example
Csharp :: https port 
Csharp :: unity ignore collision between two objects 
Csharp :: maximize window c# console 
Csharp :: slider.onchanged in unity 
Csharp :: convert json to list object c# 
Csharp :: button size xamarin 
Csharp :: C# removing the last value of an array 
Csharp :: hashset to list c# 
Csharp :: crop bitmap image c# 
Csharp :: how to add ground Check in unity 3d 
Csharp :: void ontriggerenter not working 
Csharp :: c# create object with properties 
Csharp :: reverse string c# 
Csharp :: Get key by his value on Dict C# 
Csharp :: c# get getter set setter method 
Csharp :: c# indexof 
Csharp :: solidity get address of contract 
Csharp :: c# read file line by line 
Csharp :: string reverse c# 
Csharp :: unity key up 
Csharp :: c# add char to string 
Csharp :: string to biginteger c# 
Csharp :: c# convert string to url encoding 
Csharp :: add text to combobox c# 
Csharp :: how to move object with keyboard in unity 3D 
Csharp :: c# regex find number in string 
Csharp :: c# enum syntax 
Csharp :: NET Framework 4.7.1 or a later update is already installed on this computer. 
Csharp :: item switch unity 
Csharp :: unity rewarded ads 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =