• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Recognize the same child from the same parent

Dagoba

Member
Hello!

In my game, there are 8 different objects with the same parent.
I want to know, how to check during collision if the child objects are the same objects.
If for example an apple, tomato and pear are par_fruit's children, how to check if apple collides with another apple?

I tried this method:
During collision with par_fruit:
if (object_is_ancestor(self, par_fruit)) {
// Some code here
}

The debugging returns 0 when I try to print that objec_is_ancestros return value.
Any ideas?

Thanks in advance!
 

Dagoba

Member
They already have the same parent, the thing I just want to know is that if they're the same objects, if obj_apple collides with obj_apple, then do something. But there are 8 different objects that it's kind of bad method to do check between all, because they need collision with every single object, like if obj_apple collides with obj_pineapple, then destroy both of them. If obj_apple collides with obj_apple, both of them gets destroyed but you get points for that.
 
Top