How can I create a triangle Field of vision?

Hello,

How can I draw a triangle and setup it as field of vision like this photo?

alt text

or this video

Thanks, any answer or idea is helpful.

Mikel.

I would suggest using a semi-transparent texture for the visual cone and use a script that checks if an object is within the cone of vision, something like what these guys came up with:

If that doesn’t suit your needs then you could try using colliders, so when an object enters the trigger zone (say a sphere collider set as a trigger attached to the object) you check if the angle between where the current object is facing and where the trigger object currently is, if it is within a certain threshold then you can see it.

Hope some of that points you in the right direction.