How do I check if two object touching the same object

Get help using Construct 2

Post » Sat Jan 14, 2017 7:34 am

HI
I am looking for a way to check if two object touching the same object but necessarily at the same time,

so if object1 touch an object and then object2 touched the same object something should happen,

I tried using overlapping offset for object 1 and added another condition for object 2 as below image but nothing happen when any of the objects touch the other object:

Image
B
4
Posts: 20
Reputation: 240

Post » Sat Jan 14, 2017 1:43 pm

Try this way:

Event: Sprite22 Is overlapping Sprite1
AND (another condition) Sprite22 is overlapping Sprite2

and then you add your action. This should work, if it doesn't, let me know.
B
21
S
6
Posts: 154
Reputation: 1,715

Post » Sat Jan 14, 2017 3:49 pm

thanks ChesVCF I tried it but the same problem nothing happens,

using your way or my way it only works if I checked if one object is overlapping with another, but when I check if two object are overlapping with another i doesn't work.
B
4
Posts: 20
Reputation: 240

Post » Sat Jan 14, 2017 4:05 pm

I don't understand why this doesn't work for you, for me it works fine.

Using my way, there are two conditions, and whenever they are true, an action happens. I can only imagine tant you have added some extra conditions, that aren't always true and therefore the action doesn't happen.

Try this:

- Toggle disabled (or delete) all extra conditions, that aren't the ones I told you
- Make sure you are using the event "Is overlapping" and not "Is overlapping at offset"
- Try using the event "On collision with an object"

If this doesn't work, please attach a capx and I will take a look.
B
21
S
6
Posts: 154
Reputation: 1,715

Post » Sat Jan 14, 2017 6:07 pm

I solve it,

by creating a variable x, and if the first object touch the x is set to 1

and if the other object touch the x is set to 2

and if the x = 2, do the actions.
B
4
Posts: 20
Reputation: 240

Post » Sat Jan 14, 2017 6:50 pm

Fine :) This was going to be my next solution, but I simply don't understand why the first solution didn't work.
B
21
S
6
Posts: 154
Reputation: 1,715


Return to How do I....?

Who is online

Users browsing this forum: 25games, Ashley, Yahoo [Bot] and 24 guests