How do I test if object collides with anything on specified


Here’s the thing. All game-related objects are kept on Base Layer. Additionally I have Background layer to keep things like bg tiles in. Now I have object called “bullet”. If it is colliding with special kind of wall, wall and bullet are destroyed, if it collides with anything else, only bullet is destroyed. My game has no enemies for now so it is easier to just whitelist things that need to be destroyed and if collides with anything else just remove bullet than to check every possible case separately.

Also since I don’t want BG walls to trigger premature death of a bullet check should be only done against specified layer.

You can test the layer of an object by using All objects\Layer\Test the Layer of an object event.

For example if you want to destroy something on collision only on a specified layer, simply test the layer also :

bullet is in collision with object and object is on Layer "name of layer" : delete the object