So a handy little piece of maths, if you want to loop round a set of values, ie, scrolling through a minecraft like toolbar with a mouse, you can use the toolbar current index % toolbar max index. However if you want to be able to also scroll down, so when you scroll down past 0, it jumps back up to the last slot, for example 12, mod will not work.

I found a handy little solution that plays nicely in Unreal, What you can do is add a math node, and paste this into it

(((a % b) + b) % b)

I placed mine in a function library so it would be saved for the future.