using UnityEngine;
using System.Collections;
/*NEED THIS*/
public class K_FollowTheTarget : MonoBehaviour 
{
	public transform target;
	public float noFartherThan = 1.0f,speed 5f;
	
	void Update()
	{
		float distance = Vector3.Distance(target.position,transform.position);
		if(distance > noFartherThan)// will only move while the distance is noFartherThan x units
		{
			Vector3 dir = target.position - transform.position;
			dir.Normalize();
			transform.position += dir * speed * Time.deltaTime; // using deltaTime and speed is obligatory
		}
	}
}