using UnityEngine; public class GroundDetector : MonoBehaviour { private void OnTriggerEnter(Collider other) { if (other.CompareTag("Ground")) { FindAnyObjectByType().Die(); FindAnyObjectByType().Die(); } } }