# Checking Line-Of-Sight

**URL:** <https://forum.kirupa.com/t/checking-line-of-sight/237265>\
**Category:** flash\
**Created:** [August 28, 2007, 8:01pm UTC](https://forum.kirupa.com/t/checking-line-of-sight/237265 "2007-08-28T20:01:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShooterMG](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/shootermg/32/3695_2.png) [@ShooterMG](https://forum.kirupa.com/u/ShooterMG)\
**Post date:** [August 28, 2007, 8:01pm UTC](https://forum.kirupa.com/t/checking-line-of-sight/237265/1 "2007-08-28T20:01:48Z")

</div>

Say I have a player object, an enemy object, and some obstacles. What would be the easiest and/or best way to do a check and see if the player’s line-of-sight to the enemy is not blocked? Should I use the drawing API to draw a line between the two and see if the obstacles are hitting it? Or is there a better way using the Math.Atan2() function and checking to see if any of the objects are in that path? Thanks in advance.
