Legacy Documentation: Version 5.6 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

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

Vector2.Distance

public static float Distance(Vector2 a, Vector2 b);

Description

Returns the distance between a and b.

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