Target a GameObject and follow it when it's near

Hi Guys! I want to make a Strategy Zombie Survival RPG but, I have no idea how i shall make it work :confused:

It’s Scripted in C#. I want the AI, Target a Tag when that tag Comes near. How shall i make it?

I’ve already got a Follow Script Here:

using UnityEngine;
using System.Collections;

public class EnemyAI : MonoBehaviour
{
    public int minRange;
    public bool follow;
    public float moveSpeed;
    public float rotationSpeed;
    private Transform myTransform;
    public Transform player;

    void Start()
    {
        myTransform = transform;
        player = GameObject.FindGameObjectWithTag("Player").transform;
    }

    void Update ()
    {
		if(player == null) {
			player = GameObject.FindGameObjectWithTag("Player").transform;
			if(player.name == "Cube (Transform)") {
				player = GameObject.FindGameObjectWithTag("Player").transform;
			}
		}
		
        if(player != null && Vector3.Distance(player.position, myTransform.position) < minRange)
        {
            follow=true;
        }else{
			follow=false;
		}

        if(follow && player != null)
        {
            myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(player.position - myTransform.position), rotationSpeed * Time.deltaTime);
            myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
        }
    }
}

great thing about zombies is that they can have simple AI

you could simply have the zombie LookAt() your target in question
and then go to him

to make this more dynamic you can use trigger colliders or masterful uses of raycast to set up sensing ranges to determine if a player is of a certain distance go to him or if hes gotten far enough away give up
OnTriggerEnter() & Exit

or were you asking about what the AI should do when he gets to him

ex:
create a spherical trigger collider that is like 10ft around your zombie character
OnTriggerEnter(trigger:collider)
{
if(trigger.gameobject.tag.equals(“Human”)
{
follow
}
}