Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# get vector2 distance

//For 2D Unity C#
float GetDistance(Vector2 posA, Vector2 posB) {
	float dx = posA.x - posB.x;
    float dy = posA.y - posB.y;
    float distance = Mathf.Sqrt(dx * dx + dy * dy);
    return distance;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# conver date utc to cst 
Csharp :: unity3d quaternion add 90 degrees 
Csharp :: get random from list c# 
Csharp :: winforms messagebox with button 
Csharp :: tooltip button winform 
Csharp :: snx turn off linux 
Csharp :: snx disconnect linux 
Csharp :: c# set file invisible 
Csharp :: c# convert utc to est 
Csharp :: C# inline question mark on object 
Csharp :: dapper delete where in list 
Csharp :: remove first object from list c# 
Csharp :: blank background for button wpf 
Csharp :: how to convert a number to 2 decimal places in c# 
Csharp :: c# set int infinity 
Csharp :: game object find 
Csharp :: unity get textmesh pro component 
Csharp :: c# initialize array 
Csharp :: C# Cast double to float 
Csharp :: lump in neck under jaw 
Csharp :: convert int to uint c# 
Csharp :: c# convert string to enum 
Csharp :: c# switch by type of object 
Csharp :: c# datagridview change column name 
Csharp :: difference between executescalar and executenonquery and executereader 
Csharp :: how to convert from hexadecimal to binary in c# 
Csharp :: c# how to terminate console application 
Csharp :: varibles c# 
Csharp :: create char array c# 
Csharp :: c# get user appdata folder 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =