Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Vector2.Lerp

static function Lerp(from: Vector2, to: Vector2, t: float): Vector2;
static Vector2 Lerp(Vector2 from, Vector2 to, float t);
static def Lerp(from as Vector2, to as Vector2, t as float) as Vector2

Description

Linearly interpolates between two vectors.

Interpolates between from and to by amount t.

t is clamped between [0...1]. When t = 0 returns from. When t = 1 returns to. When t = 0.5 returns the average of from and to.