I’m adding basic scrollwheel hotbar selection mechanics to my game. The way I do it is by storing the current item in a variable, getting the scroll wheel axis (either 1 or -1), finding the index of the current item in the inventory, then incrementing the index by the returned scroll axis. However, I’m getting weird logical errors where 0 >= 0 returns false:
Do you have default Selected Spell?
Find and empty Selected Spell probably will return 0?
and if you scroll +1, it will not be greater than or equal to length
it return false
Variable values may not be displayed correctly (at first glance).
You need to set a breakpoint one step later so that the branch “calculates” all variable values.
The most reliable way is to use Print String for viewing.