How would you make it so that for each instance of an object A, if its point is in collision with object B it will delete object A?
Using a Repeat for each ObjectA
loop, check whether the point is inside object B (Iâve added a new point on object A called testPoint) :
I have now come across a different issue where the inverted version of the point inside object action isnât working.
I have boxes with points âDownLeftPointâ and âDownRightPointâ
I have the object group âPlatformsâ
And this code, that should only delete a box when both points are not in collision with any platforms:
I run the preview
and when I press c, they are all deleted
I suspect whatâs happening here is that although the each box point is within the platform directly under it, itâs also not within the other platforms. So the conditions are true.
Iâd suggest using a boolean (say called deleteBox) and setting it to true at the start of the repeat for each box. Then have a subevent of the Repeat block, with an OR conditions that check whether one of the points are in a platform and setting deleteBox to false as the action.
Then have another event after that subevent that deletes the box if the boolean variable deleteBox is true.
Correction, inverting a condition checks if any object doesnât meet the condition, not if all are not meeting it. To check if the point is not inside any Platform (instead of checking if any platform does not have the point inside of it) use the not event, though it is broken with a few conditions including the âpoint inside of objectâ condition. Iâve submitted a fix already, but it still needs to be merged and the next version to be released after that:
In the meantime, you can, as MrMen suggested, use a boolean variable to do that manually: