Hello I am trying to make an enemy that will shoot the player when they come too close and stop shooting when they are out of range, I have tries using two techniques first with Line of Sight
this somewhat works as enemies will start to shoot player when they come within range, however they will continue shooting even when the player moves out of the Line of Sight range and the instance boolean variable LOS remains true.
I have also tried comparing distance variables as shown below
this solves the previous problem but creates another. there are multiple enemies on the layout however only one enemy, the first spawned in, triggers this event, not only that but when this first enemy is within range, All enemies will begin to shoot player.
I am fairly new to construct but am really enjoying it, im sure ive missed somthing obvious, if anyone can help me out I would be very appreciative. thank you