Checking whether a camera can 'see' an object

Is it possible to make it so that a camera (not necessarily the main camera) checks whether or not an object is visible to it? This is for a stealth game, so I want the enemy to trigger when the player walks into its FOV. All of the other solutions that I’ve found have just checked whether or not the object is within the ‘projected’ field of view, that is, it doesn’t matter whether there’s something in the way. Check the picture for more clarification. In that example, the blue person should be ‘seen’, whereas the red person should not be seen.


Good day.

There are so many posts and answers about this issue.

Do not expect someone to give the exact answer you need for your case… Go read about the issue and find your solution!



I dont know how I missed these I’ve been looking for ages and I couldn’t find anything that helped with this. Thanks so much