0 Favourites

How do I check if two object touching the same object

  • 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:

  • 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.

  • 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.

  • 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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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.

  • Fine This was going to be my next solution, but I simply don't understand why the first solution didn't work.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic Locked topic
198 18,657
Tom's avatar
Tom Construct Team Founder
Unread hot topic
99 10,137
karshinkoff's avatar
karshinkoff
Unread hot topic
167 14,490
DMT2005's avatar
DMT2005