Thanks a lot! I used sprite masks and set the sprite mask interaction of the wall sprites to "visible inside sprite mask" and changed the material of the sprites so they could be affected by light. The game is top down 2D.