>>87765621Your enemy AI could check the distance between itself and the player every few frames, and only after it is within a certain range does it start flanking. There's probably a built in function in your game engine to check it too so you don't have to implement the formula yourself.