Drawing player field of view
Hello,
I'm having a problem with drawin field of view of player watched from 3rd person. Please take a look at images attached images.
I want to achive effect from second image. Please notice that player cannot see thru wall so there is no yellow color behind it. Currently in unity i'm draving this with creating custom mesh in script but problem is defining the mesh structure. Only resolution that came to my mind is to raycast every 0.1f to see if there is obstance if there is then limit yellow view to this place. But this will require me to cast very much (about 100-200) raycasts per frame which may be problematic because this game is targeted for mobile device. [1]: /storage/temp/58252-view1.png [2]: /storage/temp/58254-view2.png
Any other way to resolve this problem?