Walls with doors in Unity3D

Hello! I’ve been trying to make an enemy come out of a door and then follow the player. It has to follow the player, and if the player dodges it, it has to hit a wall. I’ve got all the dodging and following sorted out thanks to this site, but here is the problem. I use a Plane as a wall. I want the enemy come through it, but I can’t because if the enemy touches the wall, it gets destroyed. Is there a way to prevent this from happening?

Just set a bool in a script called shouldbeDestroyed = false;
and once the Enemy passes the door and all animations and sort of stuff is done then simply make that bool true i.e, shouldbeDestroyed = true; and once the bool is true then only make the enemy destroyable

if(shouldbeDestroyed)
{
      DestroyEnemy();
}

void  DestroyEnemy()
{
     //your code that controls and destroys enemies
}