[Solved] How do I make overlapping trigger correctly

Get help using Construct 2

Post » Fri May 15, 2015 9:24 pm

Greetings

I have run into the following problem:

I have 3 sprites: 0006 (pink), 0007 (pink), 0001 (green). I want to make something happen when 0007 overlaps 0006 with nothing in between.

This does not work. Apparently the overlapping triggers even if there is something in between the objects. If I stack all of them together

0007
0001
0006

like so, the overlap event will trigger; and I wish that to not happen since it's wrong. (bug??)

I tried different things but none had any results. I have attached an image where the 2 pink sprites have their opacity decreased because they overlap, but they overlap in theory cause there is actually something in the way blocking the overlapping.

Image

Any suggestions?

Thanks in advance!
Last edited by Je Fawk on Tue May 19, 2015 10:32 pm, edited 1 time in total.
Black Bobby The Hole Greenlit with 303 votes.
B
35
S
8
G
1
Posts: 163
Reputation: 2,979

Post » Fri May 15, 2015 11:28 pm

I figured out a quite complex solution if anyone has this same problem again.

You make a family with all the overlapping items and you assign it an instance variable say OverlappingNumber.

Every 0.1 seconds (less or more, you decide based on the resources available) you set the whole family's OverlappingNumber = 0

Then under Every 0.1 seconds you add this event: for each family member you check if the family is overlapping with Sprite1, then in another event, Sprite2, and so on you write a huge bloody list for every sprite that you want this specific overlapping fix to add to. If it is overlapping you do Sprite1.OverlappingNumber + 1.

After that it's just a matter of testing if the overlapping number is less or equal than 1 when things overlap.
Black Bobby The Hole Greenlit with 303 votes.
B
35
S
8
G
1
Posts: 163
Reputation: 2,979

Post » Sat May 16, 2015 3:59 am

@Je Fawk
Thanks for the answer, please edit your Subject as
<SOLVED>How do I make overlapping trigger correctly
B
35
S
10
G
4
Posts: 250
Reputation: 7,908


Return to How do I....?

Who is online

Users browsing this forum: Sparkz and 3 guests