# Cycle through integer input values in geometry nodes

I am searching for a way to cycle through my input values in geometry nodes but can't find a simple way.

Lets say my inputs are integers from {0, 1, 2, 3}. What i want to achieve is that if the value is 3 and i increase it with the little arrow, it starts at 0 again instead of staying at 3. Same goes for 0, if i decrease it at 0 i want it to be at 3 instead of staying at 0.

Is there a simple way i am missing or do i have to build some construct that will check at which value it is to then change it as i desire?

• It takes a script. Count clicks and if you have 4 of them get back to 0. Sep 7, 2021 at 13:28
• If your question has been solved, please be so kind and mark the answer that contributed to the solution as "Accepted answer" so that this question will not continue to be displayed as unsolved. Thank you! Here you can find more information: What should I do if someone answers my question?. If you still haven't gotten a solution to your question, please be kind enough to address it. Oct 24, 2022 at 9:30

This is exactly what the math node Wrap does.
It gets a maximum value that must not be exceeded (in this example the node Domain Size gives me this value) and a minimum value, which in this example is $$0$$.