I'm trying to add some basic line of sight functionality to enemies in my game. The idea is that if enemies have LoS and are in range of the player, they'll start attacking.
When both LoS and Range are true, they trigger another variable called "Alerted". The problem is that when Alerted is true, the player should be able to make Alerted go false by breaking one of the triggers (Either range or LoS). When the player goes behind a wall or far enough away, Alerted doesn't become false. Am I using LoS wrong in some way?