How to add a minimum distance to a simple move to Attack function?

look at the detection area