Refer to any object that satisfies a condition e.g. hit wall

Hi there,

I’d like to know the simplest way to make the following:

From all objects available in the scene (not all instances of an object), refer to any object that satisfies a condition (e.g. collision with an object)?

For example, delete ANY object that collides with an object (e.g. wall, trap, etc).

Something like:

From all objects, if an object has collided with object B (let’s call it object A),
apply [whatever events] to object A.

Thanks a bunch.

That’s already what the event’s conditions are doing with objects: … s_concepts

Thanks for the reply.

However, I mean any object that satisfies a condition, not any instance.
E.g. not “if Enemy hits bullet, delete Enemy” which deletes the instance of Enemy object that satisfies condition.
but instead
“If any object (or object group) hits bullet, delete Object”.

If that is explained also in the link, I apologize.

You have to create a group with all the objects inside, or objects that should be deleted (following the example, I’m pretty sure you don’t want to delete the background on collision with a bullet).
To add a lot of objects to this mega-group, right click on the group >> Add an object to the group, and then select all the objects (with Shift or as you like). Select the objects and drag & drop on the group doesn’t work :wink:

Finally, of course, check the collision against the group, and delete the group instances colliding with the bullet.

Thank you. :slight_smile: Makes sense, but I remember some issues with groups in the past (some years ago). I don’t remember what I was experimenting with, and everything may work if I follow your instructions.