Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

math.lerp (procNode)

The blend from a to b by t: a at 0, b at 1, element by element.

The lerp operation of the authoring surface, called through the Luau node on proc.fieldc.operators. Operands are numbers, vectors, Columns or Fields. When every operand is a plain number or vector the answer is the plain result, folded where the node cooks; otherwise the answer is a Field: a template over its operands that whatever reads it evaluates in one dispatch together with the chain around it. Nothing dispatches for this node alone. Over numbers and animated values the answer is an animated value: the operation at every time.

The answer is a + (b - a) * t; t outside 0..1 extrapolates.

Operands of different widths widen to the widest: a number applies to every component, and a shorter vector reads 0 for the components it lacks.

Inputs

  • a (Value, default 0). The value at t = 0.
  • b (Value, default 0). The value at t = 1.
  • t (Value, default 0). The blend amount.

Outputs

  • value. The blended value.
local value = g.math.lerp(0, 10, 0.25) -- 2.5