If you look at the top right you'll see on a radar an enemy unit line of sight.
I was wondering what is the most efficient or easiest way (little code, fairly accurate. doesnt need to be perfect) to detect if something is in your line of sight? I may or may not need to render it (i likely wont).
I dont know the formula nor used any math libs/namespaces in C#
-edit-
Basically this is a 2d prototype. nothing has to be perfect and it will have movable camera, units and it will only look left right up down but not diagonally. There may be a wall blocking line of sight but nothing else. Also other enemies shouldnt trigger an action when they walk into it.
So really i need a source(enemy), a dst (player) and keep account of walls blocking vision.
-edit- i ended up using a rect. It was good enough and i was able to work on other thing in the prototype then writing raycast code.