Legacy Documentation: Version 5.1
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 function Distance(a: Vector2, b: Vector2): float;

Parameters

Description

Returns the distance between a and b.

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