How to judge the distance of the character when the AI moves, so as to pause or perform the AI movement

Sorry, I drank too much and I found out I got the axis wrong,