need enemeyAI with near follow

hey guys i am a newbie in unity and i relly desperately need this script
so i put it to the enemy the enemy follows me when i am near just follow no damage cause i already scripted damge script

the enemy follow player when near
and thanks in advance

yea i finished the fps tutorial and alot other but i still cant get or fit it out myself

not sure if i got your question but try this