I have been having this issue for a while now and I have finally decided to try and reach out for help. Just so you guys know I have search the forums and I haven't found exactly what I was looking for.
What I would like to do is have the enemies spawn from the spawn objects and when they land on the ground I would like them to choose a random direction to got between left and right.
Next I want the enemy to identify when the player is in "pursue" range and change its animation frame to 1 and moves toward the player and if it get in "attack" range of the player I want it to stop movement and change its animation frame to 2. If player is out of "attack" range and "pursue" range I would the enemy to start its regular movement based on the direction it is facing.
The results that I getting:
1. Right now I the enemy spawns randomly between intervals of five seconds, which is good but I can't get the enemy to choose a random direction once it is on the ground
2. When the player is in pursue range of the enemy the enemy will not move towards the player it just stays in the same position.
3. All enemies react the same instead of reacting to the player individually
I understand that this may be a lot that I'm asking for but I can't seem to find answer anywhere else. Any help is appreciated. Thanks.