How to get my enemies to detect presence

Hi everyone. I’m newbie at unity and having some difficulties. I created an ultra very hiper simple enemy AI which just follows some balls, on right-left or top-down, it changes according to the enemy the script is attached. Well, my problem is: Once a ball gets instatiated in the “arena”, all enemies keep following it, till it is destroyed. I would like to set a range or something else to each enemy start following the ball (Sphere or capsule collider maybe?). Other problem I have is, when the last ball is destroyed in the left side, per example, and the next one is instantiated at the right side, the enemy “blink” to the x/z position of the ball and starts following its trail. Hope you understand. Please, help me with codes, not with links or rude answers.
Here’s my code:

using UnityEngine;
using System.Collections;

public class Enemy_Top : MonoBehaviour {

	Rigidbody myBall;
	public float minHeight;
	public float maxHeight;


	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void FixedUpdate () {
		//GameObject Ball;
		//Ball = GameObject.FindGameObjectWithTag ("Bola");

		myBall = GameObject.FindWithTag ("Bola").GetComponent<Rigidbody> ();

		if(myBall.transform.position.x > transform.position.x){
			transform.position = new Vector3 (myBall.transform.position.x + 2.0f, transform.position.y, transform.position.z);
		}
			else if(myBall.transform.position.x < transform.position.x){
			transform.position = new Vector3 (myBall.transform.position.x + 2.0f, transform.position.y, transform.position.z);
		}

		if (transform.position.x > maxHeight) {
			transform.position = new Vector3(maxHeight, transform.position.y, transform.position.z);	
		}
		else if (transform.position.x < minHeight){
			transform.position = new Vector3(minHeight, transform.position.y, transform.position.z); 
		}

	}
}

either way round, the enemies can check objects in distance around them or the player can check distance, and if distnace is smaller, then activate the enemy at the distance. do it most efficient way.

you can also send rays out from teh robots facing direction, and if a ray hits the target the robot has seen it. using raycast.

You could use a trigger collider on the enemy.

function OnTriggerEnter (other : Collider) {
    
    if (other.gameObject.tag == "Player") {

        //Activate your enemy.
        //drudiverse is right that you will have to use Vector3 math to control
        //your enemy actions
    }
}