Skip to content

MapRange

Description

MapRange is a Function on Math
Maps the given value from a given range (1) to a new range (2). If you input MapRange(0.5, 0, 1, 0, 100), it will return 50 because 0.5 is in the middle of from1 and to1, and 50 is in the middle of 0 and 100.

Example
local testVariable = Math.MapRange(1.0, 1.0, 1.0, 1.0, 1.0)
Usage

network usage: Any (Client or Server/Host)
returns: float
parameters:
- value (float)
- from1 (float)
- to1 (float)
- from2 (float)
- to2 (float)