Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Distance(Vector2Int, Vector2Int)

Calculates the distance between two vectors.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static float Distance(Vector2Int a, Vector2Int b)

Parameters

The first vector to check.

The second vector to check.

Returns

Type

Description

floatThe distance between
a
and
b
.

Remarks

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