[Solved] How do I make overlapping trigger correctly

0 favourites
  • 3 posts
From the Asset Store
Game Triggers is as versatile as a Swiss army knife, and will be a great resource for any type of game you're creating.
  • 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.

    Any suggestions?

    Thanks in advance!

  • Try Construct 3

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

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

  • Fawk

    Thanks for the answer, please edit your Subject as

    <SOLVED>How do I make overlapping trigger correctly

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)