Choose only top sprite when overlapping another sprite

Get help using Construct 2

Post » Sat Apr 15, 2017 10:43 pm

I am a bit lost so it's time to ask another question...

I have a few sprites on my screen which i want to destroy if I click on them (I have managed that) :) The problem I have is if one sprite is on top of another sprite if I click the top sprite they both disappear :(

I only found 1 post that seemed similar to what I need, they talk about using system/pick Nth Instance which I tried but it did not work.

Thanks in advance for any help :)
B
5
S
1
Posts: 5
Reputation: 335

Post » Sun Apr 16, 2017 12:13 am

What exactly did you do with pick Nth instance? It should work.

Object On Clicked
Pick Nth Instance - 0

Should leave you with only one instance picked, which you can then destroy.
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303

Post » Sun Apr 16, 2017 3:01 am

I have it working now, my problem was I had the sprites disappear instead of destroyed.

Thanks for your post :)
B
5
S
1
Posts: 5
Reputation: 335

Post » Sun Apr 16, 2017 5:58 pm

Message: DJKeefy can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I am still doing something wrong :(

I have give a quick example in the image below (the sprites are set to move upwards in the behaviours). so if the red sprite overlaps the yellow sprite and I click the red sprite it destroys only the red sprite (SO THAT WORKS) but then if I click the yellow sprite, it does not destroy. :(

I will have about 10 sprites in the project that I will need to check if they are overlapping another sprite only the top one is chosen.

Sorry I can not post urls yet, so you will have to copy and paste the below image link

https://ibb.co/eNykRQ
B
5
S
1
Posts: 5
Reputation: 335


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests