Skip to content

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_nametypedescription
lhsVector3The starting vector.
rhsVector3The ending vector.
tnumberThe interpolation coefficient, representing the proportion between the start and end points.

return

typedescription
Vector3A 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));