I’m not entirely sure how to ask this question because of all the strange behavior I’m getting, but I’ll try to sum it up. basically, I have this graph code:
which is meant to change the material on an object based on the array and the integer “current_page”, however I’m getting a bunch of weird behavior.
if I set current_page to 0 in the inspector, it stays on 0 while the materials keep changing. if I set it to 1 first then the integer acts correctly being added and subtracted when it should, however the material array doesn’t really correspond to the array. 0 isn’t the material in 0, and it just cycles between material 1 and 2 over and over. if that makes sense.
if it helps any, I also have this second button which is essentially a copy of the first but in the negative direction.
this is how I know it’s cycling even though there’s only 3 values in my array. the variable will go
[0,1,2,1,0,1] but the actual materials on the object will cycle through the array like [0,1,2,1,2,1,2]
hopefully that’s a good enough explanation; please help, I’m completely baffled by this.