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.

Thanks

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!

https://forum.unity.com/threads/point-in-camera-view.72523/
https://stackoverflow.com/questions/42895445/unityhow-to-check-if-area-inside-camera-view

Bye!

Thanks

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