Collision Help,Collisions

Hello! I am making a game, where the player is in a box, and has to dodge the enemies, but can’t get out of the box. But I have the enemies coming from out of the box. I was wondering if it was possible to make it so the enemy can pass through the wall, but hit the player, while the player is in the box? Thanks!

Set the Enemy Collider to trigger. This way they dont get stopped by the wall and will kill the player when they hit him. The Player Object (sphere in picture) must have the Tag “Player”

enemies (cube in picture):
collider: is trigger: true

player:
collider: is trigger: false

using UnityEngine;

public class EnemyTrigger: MonoBehaviour
{

    private void OnTriggerEnter(Collider other)
    {
        if (other.tag.Equals("Player"))
        {
            Destroy(other.gameObject);
            
        }
    }
}