can someone explain pick to me? Not working

Get help using Construct 2

Post » Thu Dec 15, 2016 3:16 pm

I have 10 icons with inst variable. obj_icon with click event
I have 10 other icons with the same inst variable. obj_icon2 with draggable
I have 10 other icons with the same inst variable. checkmark to show result.
I have a text to show the value of checkIconNum to make sure it is correct.

On the click event, I have a global variable that is set the the obj_icon instance variable and then this icon is destroyed to eliminate the click event.
Image
On the drop event of the second icon, I have this code.

Image

My problem is that there is no consistency. the 2 first chosen icons work as expected and then the following ones sometime work correctly, sometimes the wrong icon is detroyed.


Could anyone tell me what I am doing wrong?
B
8
S
1
Posts: 86
Reputation: 618

Post » Thu Dec 15, 2016 3:32 pm

Did you set the instance for both objects? You should give them the same instance to check them.

What I see is you setting the instance of the icon to a variable, but where is the obj_check instance being set?
Image
B
108
S
24
G
18
Posts: 1,376
Reputation: 22,830

Post » Thu Dec 15, 2016 5:29 pm

i have the same instances for all the icons from 0 to 9 set in the UI. I gave them the same name inst_ID
so I have:
- obj_icon inst_ID 0 to 9
- obj_icon2 inst_ID 0 to 9
- obj_check inst_ID 0 to 9

It seems like since I check these against the same variable, they should be the same. I could PM you a link to my file is your are willing to look at it. I am a beginner and things mystify me a little coming from javascript.
B
8
S
1
Posts: 86
Reputation: 618


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 15 guests