can give them a variable that tells who they are currently hit by:
step event
And in collision event it check that value of the other object, but only if it have not been detected yet, so its own hit variable need to be noone
Code:
// do not do anything if already hit
if(hit!=noone) exit;
if(other.hit == noone){
// first time we hit anything this step
// then let them remember eachother
hit = other.id;
other.hit = id;
}else{
// you hit something that already have
// collided, you can then use hit in
// the other object to check if they
// all touch
if place_meeting(x,y,other.hit){
instance_destroy()
instance_destroy(other.hit)
instance_destroy(other.id)
// Create instance here
}
}
Couple issues here.
Four asteroids: A, B, C, D
A hits B, a.hit=B, B.hit=A
C hits A, A's event exits, C.hit=A, C checks B...
Outcome 1: C is colliding with B at the exact moment C initially collides with A, all is good
Outcome 2: C is not colliding with B, no more asteroid collisions can be handled by A, B, or C
A hits B
C hits D
A and B then hit C but not D, no collisions are handled
A hits C
B hits D but not A or C
D hits A and C, but code forced to exit
Setting hit for both instances kills the code anyway, but even without that, you'd still be relying on instance ordering, so even the logic lets it down.
What I would do is every step:
Code:
var inst; inst[1]=0;
var cnt=0;
with object_index if place_meeting(x,y,other.id) inst[cnt++]=id;
if cnt==2 {
instance_create(mean(x,inst[0].x,inst[1].x), mean(y,inst[0].y,inst[1].y), new_thingy);
instance_destroy(inst[0]);
instance_destroy(inst[1];
instance_destroy();
}