// Destroy everything that leaves the trigger function OnTriggerExit (other : Collider) { Destroy(other.gameObject); }
using UnityEngine; using System.Collections; public class Example : MonoBehaviour { void OnTriggerExit(Collider other) { Destroy(other.gameObject); } }
import UnityEngine import System.Collections public class Example(MonoBehaviour): def OnTriggerExit(other as Collider) as void: Destroy(other.gameObject)