Hi,
I have an enemy that pathfinds to player if player is within a certain distance of the enemy, and the enemy also has the line of sight behavior to allow for it to aim towards the player to throw missiles.
Right now when the distance between player and enemy for which pathfinding and line of sight applies is exceeded, the enemy starts to walk back and forth between two grid points and the animation is also playing.
I have tried to solve the problen by saying that if the maximum distance for triggering pathfinding is exceeded as well as the line of sight is lost, stop animation and stop pathfinding. However, with this event implemented the enemy still behaves as described above.
What other approach could I take to solve this problem?