How do I register overlap with same object?

0 favourites
  • 4 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hi guys,

    So I have a really weird problem. When I try to register if an object is overlapping with a different instance of the same object, construct doesn't register it! Look at the pics:

    I create 10 boxes at the start, then check if a box is overlapping another box, but construct never returns it. Only returns when it is not overlapping.

    What is happening?

    Thanks!

  • Yes, and I checked that the collision box covers the entire object.

  • It's not working because you are mentioning the same object twice. Construct won't know which instance to pick. A workaround is to create two families with the same object and then, on creation, put their UIDs in a family's instance variable(let's say ObjUID). Now you just need to verify if family1 is overlapping family2 and check if family1.ObjUID is different from family2.ObjUID. If its different then you know that you are dealing with two different instances of the same object.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's not working because you are mentioning the same object twice. Construct won't know each instance to pick. A workaround is to create two families with the same object and then, on creation, put their UIDs in a family's instance variable(let's say ObjUID). Now you just need to verify if family1 is overlapping family2 and check if family1.ObjUID is different from family2.ObjUID. If its different then you know that you are dealing with two different instances of the same object.

    Sounds reasonable. Thanks! I'll try it.

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