Hey, so I’m making a simple horror game where you have to use flashlight (flash the enemy) to stop them from chasing you. However, whenever I flash the enemies, they keep chasing, but if I manually set the “Is Flashed?” boolean to true, they don’t chase at all, so the boolean has the right effect.
I attached some screeshots of the player and enemy AI.
An easy way would be to store the sensed player. If flash is true, empty the player variable and return to (maybe roaming? searching?) - or just sensing again
So what I would suggest is a cone trace for objects on your flashlight, and any objects with tag “Enemy” (Provided, set a tag for them!) you’ll cast to your Enemy BP and forEach on the array to “Get AI controller” >cast to your ai controller → Activate a Custom Event. That custom event needs to set “is flashed” to true, and have them do something else.
I suggest a timer or delay at the end of your custom event, that will be linked to a Gate node before your Sequence node. On event start, maybe use another custom event to close the gate, in line with the first custom event. After the timer or delay
on the custom event, open the gate.