Skip to content
Permalink
c222c96d18
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
14 lines (10 sloc) 268 Bytes
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DestroyByBoundary : MonoBehaviour
{
void OnTriggerExit2D(Collider2D other) //destroys object if outside of boundary
{
Destroy(other.gameObject);
}
}