- Home /
Top down LOS/Field of View
Hey everybody,
I've recently started work on a topdown 3d shooter game and I'm currently trying to implement a cone shaped field of view for the player. I've searched for quite a while but am still clueless as to where to start.
I basically want the player to only be able to see infront of him in a cone shape, everywhere else should be black unless the player rotates. I've looked into using raycasts but I couldn't figure out or if it was possible to join 2 raycasts together to for a triangle.
Another way I've been looking at is to have the whole room dark and have a spotlight attached to the character using deferred lighting but I don't want other players to be able to see the light.
I found this http://ncase.me/sight-and-light/ which would be pretty ideal using raycasts and alpha masks however I'm not really sure how I would make a cone as opposed to sphere cast.
If someone would be able to point me in the right direction I would greatly appreciate it or any suggestions on other ways to accomplish this. I'm really stuck at the moment.
Cheers
Actually, there are lots of tutorials on this:
I've gone through the majority of google already and found no tutorials on how to do this. It's either people demonstrating their project or people asking for help.