Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit8d45df8664

README.md

value.expr (procNode)

A number that follows one Luau expression over the graph's clock: t (seconds), frame, fps, duration, pi, the math functions by bare name (abs, acos, asin, atan, ceil, cos, deg, exp, floor, log, max, min, rad, sign, sin, sqrt, tan), clamp, lerp(a, b, k), smoothstep(a, b, x), noise(x, seed) and the names variables gives. The expression is run once with those names bound to sockets, so it becomes arithmetic in the graph: it follows the clock on every present and re-cooks nothing.

Inputs

  • variables (Record, optional): the names the expression reads beyond the built-in ones, each a number, a graph input or another node's number. A built-in name is read before a variable of the same name.
  • expression (String, default "t"): one Luau expression, written without return. An empty expression is refused, and one that does not compile is refused with the compiler's message.

Outputs

  • value (Float): the expression's value.

Example

local bob = g.value.expr({ expression = "height * sin(t * speed)", variables = { height = 0.5, speed = 2 } })