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

public class DestroyOnTriggerEnter : MonoBehaviour
{
    GameObject janitor;
    private void Start()
    {
        janitor = GameObject.Find("Janitor");
    }
    private void Update()
    {
        if(Vector3.Distance(janitor.transform.position,transform.position) < 1f)
        {
            Destroy(gameObject);
        }
    }
}
