Collision problem

Hi everyone,

I am developing a small project and I have encountered an obstacle that I can not overcome.

Let’s put the situation:

For starters everything is 2D environment. I have a series of Sprites that each include a BoxCollider2D to recognize some collision. These Sprites move freely by a square created by 4 BoxCollider2D. The idea is that the Sprites DO NOT Collision between them, acting in a way like Triggers. But they YES Collision with the 4 Boxcollider2D that form the “walls” of the square so that they do not escape.

The clear problem is that if the Sprites hit the wall they collide with each other. And if they do not collide between them they leave the game through the walls as if they were Triggers.

I hope your help and thank you very much!

Put the sprites on one layer and the bounding colliders on another. Then set up the collision layer matrix so that sprites don’t collide with each other, but they do collide with the walls.