Garry's Mod Wiki

Garry's Mod Wiki

  number math.Remap( number value, number inMin, number inMax, number outMin, number outMax )

Description

Remaps the value from one range to another

Arguments

1 number value
The value
2 number inMin
The minimum of the initial range
3 number inMax
The maximum of the initial range
4 number outMin
The minimum of new range
5 number outMax
The maximum of new range

Returns

1 number
The number in the new range

Example

Example usage, converts a value from range 0-1, to range 0-255.

print( math.Remap( 0.5, 0, 1, 0, 255 ) )
Output: 127.5

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...