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
Answer by tormentoarmagedoom · Sep 17, 2018 at 11:07 AM
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://answers.unity.com/questions/22314/how-to-check-if-a-point-is-seeable-by-a-camera.html https://forum.unity.com/threads/point-in-camera-view.72523/ https://stackoverflow.com/questions/42895445/unityhow-to-check-if-area-inside-camera-view
Bye!
Answer by Anonymouse_ · Sep 20, 2018 at 08:57 AM
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
Your answer
Follow this Question
Related Questions
Top Down Camera View Problem 1 Answer
What this error? 0 Answers
Plotting a camera path 0 Answers
Camera X Rotation Problems 0 Answers
Tilting Head with Camera from the FirstPersonController Script FPS controller provided in (Unity 5) 2 Answers