Skip to content

format

typescript
Vector3.Distance(lhs, rhs)

class: Vector3

description

Calculates the straight-line distance between two vectors.

parameter

param_nametypedescription
lhsVector3Vector 1 participating in the distance calculation.
rhsVector3Vector 2 participating in the distance calculation.

return

typedescription
numberThe straight-line distance between the two vectors.

code example

typescript
let from = new Vector3(1,2,3);
let to = new Vector3(3,4,5);
Debug.Log("Distance is",Vector3.Distance(from,to));