Detecting if random placed map pieces are colliding

I am currently making a simple random map pieces generator, but my problem is that the pieces are sometimes colliding with each other.

I made it the map pieces with 3 spawn points “and those are getting randomized”.

But sometimes clip in each other like this>

What I want to make is a check system if the current placed “tile/map piece” is colliding with another one and switch to number 1,2 or 3.

I solved the problem by putting a box trigger on the separate pieces.