format
typescript
Vector3.Lerp(lhs, rhs, t)class: Vector3
description
Performs a linear interpolation between vector lhs and vector rhs using t.
t is only valid within the range of 0 to 1. If t is less than 0, it will be clamped to 0. If t is greater than 1, it will be clamped to 1.
parameter
| param_name | type | description |
|---|---|---|
| lhs | Vector3 | The starting vector. |
| rhs | Vector3 | The ending vector. |
| t | number | The interpolation coefficient, representing the proportion between the start and end points. |
return
| type | description |
|---|---|
Vector3 | A new Vector3 object. |
code example
typescript
let from = new Vector3(1,2,3);
let to = new Vector3(3,4,5);
Debug.Log("Lerp is",Vector3.Lerp(from,to,0.3));