C
C#•9mo ago
Trapyy

Variables in a class not changing?

I have this IndexSwitcher class: i instantiate this class with the initial value of 0 when i use the switchIndex method, the currentValue variable prints out newIndex like it is supposed to, but when i use the GoToLastIndex, currentIndex always prints out the initial value that is 0, why doesnt it update when i use the SwitchIndex?
No description
2 Replies
Pobiega
Pobiega•9mo ago
Are you sure it's the same instance of the switcher?
Trapyy
TrapyyOP•9mo ago
omg im so dumb 😭 i instantiated it two times thank you
Want results from more Discord servers?
Add your server