When my AI enemy sees the player or their teammate, I want them to stay in one spot, not move, and shoot at the player. During this shooting period, the AI's state is called "FIRE." But instead of staying still, the AI moves toward the player because it's rapidly switching states instead of staying in the "FIRE" state.
I suspect the problem lies right here
Here is also the code for entering the firing mode
And here is a video of my problem youtu.be/zhahEBQQ1qo
Any and all help is appreciated!