How to prevent tap event going through sprites?

Get help using Construct 2

Post » Tue Feb 03, 2015 2:16 am

if two sprites are partially overlapping how can I make a tap event that only destroys the top one if that is the one that is tapped?
B
27
S
10
G
6
Posts: 251
Reputation: 6,630

Post » Tue Feb 03, 2015 2:29 am

If they're the same object type, add "Pick top instance" from your sprite's conditions to the "On tap" event.
Moderator
B
109
S
41
G
20
Posts: 1,586
Reputation: 18,996

Post » Tue Feb 03, 2015 2:38 am

linkman2004 wrote:If they're the same object type, add "Pick top instance" from your sprite's conditions to the "On tap" event.


Thank you very much!!!!! :)

But what if they are not the same object type?
B
27
S
10
G
6
Posts: 251
Reputation: 6,630

Post » Tue Feb 03, 2015 3:33 am

Put any objects you want to destroy with taps into a family, then change your event to use that family instead of the sprites.
Moderator
B
109
S
41
G
20
Posts: 1,586
Reputation: 18,996

Post » Tue Feb 03, 2015 10:56 am

linkman2004 wrote:Put any objects you want to destroy with taps into a family, then change your event to use that family instead of the sprites.

Thanks again!

This was a huge help for me :D
B
27
S
10
G
6
Posts: 251
Reputation: 6,630


Return to How do I....?

Who is online

Users browsing this forum: Burgrokash, Carlafnt, Flipy, MatheusCastellar, Taser and 10 guests