Hello, I am making a top-down shooter game and I'm having some trouble making some enemy AI. I'm using a state machine and I the enemy to have 3 stages:
An idle stage where the enemy roams around the map
An attack stage where the enemy turns to the player or the players teammate (Whoever is in the enemies line of sight) and shoots at them
A chase stage where the enemy goes to its target's last seen position once the target breaks the line of sight.
The player is accompanied by teammates that are also targets for the enemy.
Any help is greatly appreciated!