I have a grounded enemy with a simple chase state. When in this state, the enemy moves with constant vel.x toward the player.
If my player jumps directly above the enemy however, the enemy will quickly flip directions back and forth a few times, since each time the vel.x is updated it flips sign. If the player is on a ladder above the enemy, the enemy will just oscillate back and forth indefinitely. Very ugly.
My enemy does have an engaged state where he pauses and then attacks, but my player has a high jump and so can maintain a far enough distance to avoid triggering the enemy to enter this state.
I am wondering what design choices I can make to prevent this ugly oscillation back and forth during chase.