Hello all. I am new to construct and I try to figure out how it works by making some simple test programs.
In one of these programs I try to select a box with the left click, move it on the screen with the right click.
I have added a private variable "select" that is 1 if the box is selected and 0 if not (default is 0)
All is fine with one box. But then I added via code another box (System:Create object Box).
Now I select one box, (testing this using a different border), and when I right-click to move both boxes move together. The fact is that I also check for another condition (destination right click)
Now I have noticed that when I check first the box "select" variable against 1 and then the destination it makes both boxes go there.
But when I check the destination first then the private variable it makes the correct decision and only the selected box move to the destination... as intended.
Now this is a huge problem. In my view the 2 ifs must give the same decision regardless of order. But it seems that is not the case.
Please tell me what I am doing wrong or why this is happening. (I got to know the reason so I make it right in the future).
Also, if anyone can tell me more about how you can select an object from the other similar ones using other methods than comparing a private variable. (maybe there is a better way).
Thank you.
(sorry for my English.. not native)