Legacy Documentation: Version 5.2
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Vector2.Distance

Switch to Manual
public static float Distance(Vector2 a, Vector2 b);

Parameters

Description

Returns the distance between a and b.

Vector2.Distance(a,b) is the same as (a-b).magnitude.