How do I select an object overlapping another?

Get help using Construct 2

Post » Tue Aug 15, 2017 3:20 pm

I have this mouse event when I click on an object it toggles a certain variable to true..

The situation is when two of these objects are overlapping and the cursor is overlapping both objects, and I click, it toggles both of their variables..

How do I toggle the value of the one object overlapping the other or one with a higher Y value?
B
4
Posts: 12
Reputation: 226

Post » Tue Aug 15, 2017 4:03 pm

On the collision event, you can pick the individual objects using system pick nth instance. Instance 0 is one of the objects and Instance 1 is the other one. In this way you can split them out and apply the actions to the overlapping objects separately.
B
46
S
16
G
78
Posts: 2,168
Reputation: 46,353

Post » Wed Aug 16, 2017 9:58 am

Here's an example,
Image
B
27
S
10
G
2
Posts: 237
Reputation: 3,330

Post » Wed Aug 16, 2017 2:14 pm

elafreat wrote:Here's an example,
Image

Useful.I got it.
B
1
Posts: 5
Reputation: 135

Post » Wed Aug 16, 2017 5:44 pm

Nice. Thanks, guys.
B
4
Posts: 12
Reputation: 226


Return to How do I....?

Who is online

Users browsing this forum: Darknessed, FabianB and 46 guests