On Touched Object: does it work across objects?

Get help using Construct 2

Post » Tue Oct 08, 2013 7:42 pm

Hi,

Situation:

There's a big transparent sprite called Area1.
There's a sprite called Circle1 somewhere overlapping Area1.

Question: Does touching Circle1 also activate what's below, i.e. the On Touched Object event of Area1?


Right now it seems that in most cases this is indeed the case, but not always. Sometimes only the topmost object's event 'kicks in'. How is it supposed to work?
B
16
S
7
G
1
Posts: 161
Reputation: 3,131

Post » Tue Oct 08, 2013 7:55 pm

Yes if you touch the sprite then it will trigger the 'on touched' event. Sprite z-order/layer/visibility doesn't matter.

Touching the sprite means touching inside it's collision polygon so if it's not working sometimes that's the first thing I would check.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Tue Oct 08, 2013 8:42 pm

Ok, so if I touch a sprite, all the spites below it will also receive the 'on touched' event trigger. Good.

I've checked my polygons but they are fine. Now it seems the problem may lie elsewhere: my Area1 (as in the example) consists of a few transparent rectangular sprites because of its complicated shape.

So maybe the Area1 event is not triggered when I accidentaly touch the small gap between the components. Will check...
B
16
S
7
G
1
Posts: 161
Reputation: 3,131


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, JackTYGA, worm1 and 26 guests