how to draw vision cone?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By potatobanana

how to draw vision cone? i dont know where to start.
i also want to detect if body/area inside the cone

something like this enter image description here

:bust_in_silhouette: Reply From: Inces

use default collision polygonal shape, get its points that define wideness, and multiply them by some variable to control vision spread. You can use the same array of points to draw visual representation of vision wih draw call

For anyone stumbling on this question, check out my vision cone plugin