Pass thru objects selectively

My case is that, The player will collide with enemy objects but the enemy objects could pass thru each other.
I have no idea how it could be done in Unity either by coding or simply a combination of colliders.
Could anyone give me some hints on it.

function OnCollisionEnter(collision : Collision) {
{
if(collision.gameObject.CompareTag("enemy"))
{
Physics.IgnoreCollision(collision.collider,collider);
}
}

Just a general direction for you. You’d have to make it fit your exact needs :slight_smile:

Or you could simply put all enemies on one layer and use the layer collision matrix (Edit->Project Settings->Physics) to ignore collisiosn between objects of that layer