You could try every X seconds : enemy set angle to 0(look right), assuming their current angle is 180(look left).
It goes through walls in what kind of game? If it's a top down game you can use Pathfinding instead and add the walls as obstacles. Find path to player, and it will go around the walls.