using UnityEngine;
using System.Collections;

public class AltTarget : MonoBehaviour {
	
	public Transform ActiveBot;
	
	public float distance;
	
	public float distancemin;
	
	// Use this for initialization
	void Start () {
	
		distancemin=5.0f;
		
	}
	
	// Update is called once per frame
	void Update () {
		
		distance=Mathf.Sqrt(Mathf.Pow(transform.position.x-ActiveBot.position.x,2)+Mathf.Pow(transform.position.z-ActiveBot.position.z,2));
	
		if(distance<distancemin)
		{
			transform.position=new Vector3(Random.Range(-14,17),0,Random.Range (-22,18));
		}
		
	}
}
