<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [server](./server.md) &gt; [Vector2](./server.vector2.md) &gt; [distance](./server.vector2.distance.md)

## Vector2.distance() method

Calculates the distance between the current vector and another vector.

**Signature:**

```typescript
distance(vector2: Vector2): number;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

vector2


</td><td>

[Vector2](./server.vector2.md)


</td><td>

The vector to calculate the distance to.


</td></tr>
</tbody></table>
**Returns:**

number

The distance between the two vectors.

