How to overlap 2 instances from the same object

Get help using Construct 2

Post » Wed Feb 06, 2013 4:31 am

Hi there,

I need to validate when an instance of an object is overlapping another instance from any object, the issue here is that works like a charm when I validate this condition against different objects but when I try to validate 2 instances from the same object stops working.

Please take in consideration that I'm using "for each object" because I need to validate this for over 40 instances and without it doesn't update the information for each instance.

Hope you understand what I'm saying... And in advance thanks before!
Posts: 1
Reputation: 1,116

Post » Wed Feb 06, 2013 4:54 am

I fussed about with this for a long time.

What I ended up doing was creating a second sprite called "HitMask" that was the same height and width of the object I want to check. I then pin it to the object (eg. HitMask is pinned to SpriteA) and set HitMask to invisible. Now any subsequent overlap/collision conditions I need to call like "SpriteA overlapping SpriteA" are now called using "SpriteA overlapping HitMask".

You will probably need to save the UID of SpriteA to an instance variable in HitMask so that you can reselect it before your overlap condition (otherwise it will just use the first instance of the HitMask sprite).

Posts: 244
Reputation: 3,462

Return to How do I....?

Who is online

Users browsing this forum: nvdd and 25 guests