How to have multiple colliders intersect without colliding with each other?

Hello everyone!

I am developing a kid’s driving game.
I have a small city map, and I added colliders to empty game objects giving the shape
of the buildings/obtacles and avoid using mesh colliders.

For most of the cases, the colliders intersect, check picture1

The empty gameobject(EGO) has also rigidbody component attached (for collision to occur).
As I run the game, a mess happens and the colliders collide with each other(natural to happen, since they are touching each other) see pictue2
8534-picture2.jpg

now I solved this with a non-efficient method.
I had all EGOs as a child to another parent EGO named “colliders”.
I duplicated colliders, made all the child colliders to be triggers and added rigidbody component.

Hence the colliders serve as colliders, and I check the collision by OnTriggerEnter, since there is a trigger at the same position(its duplicate).

Is this the way its going to be?
How to use colliders in an optimal way?

If you don’t intend for those objects to move, you should remove rigidbody from the collider(s), Other rigid body will still interact with them as if they were brick walls.

You can also Put all those ground objects On a Layer Called: Obsticals, and your cars to use a layer called: Cars…

Then Click on [Edit] → [ProjectSettings] → [Physics]
And then make it so Obsticals do not interactice with Obsticals