Details
Features
Contents
Reviews
Limit / Constrain / Clamp / Clip Script - Return values that are limited between a minimum and maximum number.
Many times, you need to limit a number to fit certain parameters. You may want to limit volume from 0.0 to 1.0. You may want to limit size to between 0.01 and 64.0.
This simple function will make it easy. Here is an example of limiting a global float to be between 0 and 1.
gfVolume = ufConstrain(gfVolume, 0.0, 1.0);
See how easy that is? The function is compact and you can paste it in any script.
User Agreement:
You may use the function or script in anything you make and sell. PLEASE respect the work of others, and do not sell the script as a stand-alone product or in a bundle of scripts. That is stealing.
- Easy to use.
- Instructions included.
- Three examples included.
- Limit floats, integers, and vectors, easily.
- Use it in items you sell!