Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

math.map (procNode)

A value moved from one range to another, element by element: x at inMin becomes outMin, x at inMax becomes outMax, and the values between keep their place. A value outside the input range lands outside the output range. An input range of no width answers outMin.

The map 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.

Inputs

  • x (Value, default 0). The value.
  • inMin (Value, default 0). The input range's start.
  • inMax (Value, default 1). The input range's end.
  • outMin (Value, default 0). The output range's start.
  • outMax (Value, default 1). The output range's end.

Outputs

  • value. The value in the output range.
local value = g.math.map({ x = 5, inMin = 0, inMax = 10, outMin = 100, outMax = 200 }) -- 150