math.Clamp
From GMod Wiki
Function | |
Syntax |
math.Clamp( Number Value, Number Lower Bound, Number Upper Bound ) Where is this used? |
Description: | |
Forces a number into the specified boundaries | |
Returns: | Number |
Part of Library: | math |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Math.Clamp]Math.Clamp [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Description | Demonstration of use |
---|---|
Used on | |
Code | local a = math.Clamp( input, -100, 100 ) |
Output | Variable a will be no less than -100 and no more than 100. |