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