Clicking only one object of two in same place

Get help using Construct 2

Post » Thu Feb 14, 2013 7:41 pm

I'm sure this is simple and has been answered before but I can't find an answer.

I have two objects in the same place which switch screens (layers). When one is clicked, it switches to screen A, when the other is clicked, I switch to screen B. But they're both in the same place. Problem is, both are being clicked at the same time so only one works (i.e both get processed).

I'm checking the layer of the object, which I normally use in these situations but it's not working.

E.G

If mouse clicks on sprite A.
SpriteA.LayerName is visible   .... Switch to Screen B

If mouse click on sprite B
SpriteB.LayerName is visible   .... Switch to Screen A.

I would have thought checking the layername would fix this but it's not working.
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Post » Thu Feb 14, 2013 10:23 pm

@farflamex
have you tried adding a variable to control the layer picking?

layer picking example (r119)wretchedshark2013-02-14 22:23:53
B
14
S
6
G
2
Posts: 136
Reputation: 3,210


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Google [Bot], mnashwan, shinkan, stylie1, tarek2 and 11 guests