Does anyone know a clever way to check for collisions on multiple layers? For example I have my sprites on Layer 2 but my collision mask is on Layer 1 which is also invisible. This is mainly for projectiles so I want to avoid having multiple objects for collisions. The way I figured how to do it is that each object on Layer 2 has these four events:
- Always
Run a for each loop "collision"
- On loop "collision"
Move to Layer 1
- On loop "collision"
- Object is overlapping obstacle
Destroy
- On loop "collision"
Move to Layer 2
I have no idea how costly this would be performance-wise. What do you guys think?
BTW - This is not intended to be a pixel-perfect detection system, it's mostly used for projectiles when they smash against walls and the player, etc.