using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class KillDistantObjects : MonoBehaviour {
	float nextCheck;
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		if(Time.time > nextCheck){
			if((transform.position - ObjectHurler.CentreOfWorld()).magnitude > 10)
				Destroy(gameObject);
			nextCheck = Time.time + Random.Range(1f, 2f);
		}
			
	}
}
