How to make a collider be is trigger to some certain layers but be normal to others?

I want my enemy’s collider is a trigger to the player (has a player layer) but is normal to other colliders. When the enemy touches the player it doesn’t get stopped but the OnTriggerEnter2D (or OnCollisionEnter2D) still got called.

If you want to have your collider only work to certain layers (and therefore objects on those layer), go to Edit → project settings ->Physics (or Physics 2d if you are using 2D collider). Scroll down where you can find the Layer Collision Matrix

I also really need this. The collision matrix doesn’t work here because then there’s no way to tell if the object for which it should only a trigger touched it with it.