using UnityEngine; public class Destroyer : MonoBehaviour { // Destroy the GameObject this component is attached to public void DestroySelf() { Destroy(gameObject); } }