format
typescript
Vector3.Distance(lhs, rhs)class: Vector3
description
Calculates the straight-line distance between two vectors.
parameter
| param_name | type | description |
|---|---|---|
| lhs | Vector3 | Vector 1 participating in the distance calculation. |
| rhs | Vector3 | Vector 2 participating in the distance calculation. |
return
| type | description |
|---|---|
number | The 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));