Okey, I recreated your code literally and, as expected, it behaves exactly like in your example, no surprises there ![]()
Only that it’s not exactly what I wanted and doesn’t really answer the question from my last message ![]()
Yes, in your code there is a bunch of differences compared to my original code, no need to be snarky. Most notably, the Inventory holds the Boolean toggle, that’s why it works, and that’s why my code also worked when I clicked any other object, vide:
I want the boolean to be in the object I click, in your code that would be the button Arrow, and it seems to break the flow, because it sets the boolean to 0.
Go ahead, try for yourself. In brand new project create just one sprite, add behaviour: ButtonFSM, add one boolean variable to it and the below code, then check the console:
LMB toggles between true/false, “i” key always returns 0. You can’t claim any other code influences this part xD
If you use a Number type instead and e.g. increment it by 1 on click, it gets even weirder: “i” returns 0, after which LMB continues incrementing where it left off. As if they were referring to two independent variables!
Can anyone explain this? Is this expected behaviour?

