How do I register overlap with same object?

Get help using Construct 2

Post » Sun Apr 09, 2017 9:14 pm

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:

Image

Image

Image

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? :shock:

Thanks!
B
25
S
8
Posts: 84
Reputation: 1,697

Post » Sun Apr 09, 2017 9:15 pm

Yes, and I checked that the collision box covers the entire object.
B
25
S
8
Posts: 84
Reputation: 1,697

Post » Sun Apr 09, 2017 11:15 pm

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.
Last edited by kossglobal on Mon Apr 10, 2017 3:08 am, edited 1 time in total.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Sun Apr 09, 2017 11:26 pm

kossglobal wrote: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.
B
25
S
8
Posts: 84
Reputation: 1,697


Return to How do I....?

Who is online

Users browsing this forum: evillair, Yahoo [Bot] and 7 guests