Enemy view zone

Hi everyone! Making 2D top down game, and I need to make a view zone for enemy. It has to be something similar for shadows. For example enemy cant see trough the wall, he’s field of view has to be some king a ‘cutted’. Was idea to make a plane, but don’t know how to make it cut when enemy near the wall.

Try using Raycasting.

In one of the projects I used such approach: Player has a trigger, when Enemy enter in the trigger Player detect him and calculate an Angle between own forward vector and vector towards to Enemy, after this all you need is to check if Angle in the margins and if there is not anything between Player and Enemy (for this Raycasting is the best way, I think).