0 Favourites

How do I register overlap with same object?

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

  • Construct 3

    Buy Construct 3

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

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

  • 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)
Similar Topics Posts Views Last Post
Unread hot topic
99 10,137
karshinkoff's avatar
karshinkoff
Unread hot topic
167 14,497
DMT2005's avatar
DMT2005
Unread hot topic
123 14,873
Zebbi's avatar
Zebbi