I have this variable that is equal to a intvalue but when i print this variable it would print the original value of the intvalue and it would not update with the intvalue. Any solution for this?
You need to set your variable again the second time. When you set a variable equal to another variable it doesn’t create a reference, it just assigns the value of the first variable to the second. So in your example when you call that variable again, it hasn’t changed since you originally set it to 1.