Reset Integer

if you want an integer to loop around, instead of using clamp, you should use the modulus operator, which gives you the remainder after division.

lets say X equals 11.
"X modulus 4" would return a 3, because 11 divided by 4 is "2 remainder 3", and modulus only returns the remainder.

so if your integer is X, and you want to keep it looping between 0 and 3, you can set X to equal “X mod 4” or

X = X % 4;