Method Lerp
Lerp(Vector2, Vector2, Single)
Performs a linear interpolation between two vectors.
Declaration
public static Vector2 Lerp(Vector2 start, Vector2 end, float amount)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | start | Start vector. |
| Vector2 | end | End vector. |
| System.Single | amount | Value between 0 and 1 indicating the weight of |
Returns
| Type | Description |
|---|---|
| Vector2 | The linear interpolation of the two vectors. |
Remarks
This method performs the linear interpolation based on the following formula.
start + (end - start) * amount
Passing amount a value of 0 will cause start to be returned; a value of 1 will cause end to be returned.