Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

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

Vector2.Distance

static function Distance(a: Vector2, b: Vector2): float;
static float Distance(Vector2 a, Vector2 b);
static def Distance(a as Vector2, b as Vector2) as float

Description

Returns the distance between a and b.

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