I need to be able to create a number of vision sensors on an NPC. These need to be able to detect if the NPC can “see” other game objects, so it needs to take occlusion into account.
I was told there was two ways to do this.
-
Cast Rays in an arc - I can do this, however, as the rays get further from the oragin, there are gaps between them. Meaning something could be in the vision cone but be in a “blind spot”.
-
Attach a camera to the NPC and check if the game object is visable to that camera - … I was told this was possible but I cant find any guides on how to do this and access the information. Is this actually a possible method? And if so, is it a computationally expensive way to go?
Thanks for the help!