Quantcast
Channel: GameSalad 101 — GameSalad Forums
Viewing all articles
Browse latest Browse all 8930

Capping a value?

$
0
0

TL;DR - How to make x=x+1 cap at 10?

I mis-expected what the "max" function would do, and when looking for alternatives the ceil seems to be about rounding and Constrain seems to be more of a post-process than the pre-process I'm looking for. Does one of the Functions take a value and insure a variable does not go past that boundary? Do I need to make "if x > 10 then x = 10" type clean-up commands at the end of my loops, or is there a single clean function which already does that?


Viewing all articles
Browse latest Browse all 8930

Trending Articles