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

public class DestroyWhenOutsideBounds : MonoBehaviour
{
    public Bounds bounds;
    Vector3 startPos;
    void Start()
    {
        startPos = transform.position;
    }
    void Update()
    {
        // using startpos offset
        if (!bounds.Contains(transform.position - startPos))
        {
            Destroy(gameObject);
        }
    }
}
