I am using RayCastCallback
to detect the line of sight. So I the enemy avoid seeing the player through walls, problem is there's a limited field of view. So I added another two rays to the left and right side, with a total of 3 rays. Another problem is when the distance is longer the rays can't handle to see the player, so I added another more rays to fill the field of view. I don't know if this kind of idea is good or there is a better way without using rays?
Look in the below image, it seems the there is a circular sensor or like a radar. I am trying to achieve this kind of enemy sight (enemy sight demo ).