using UnityEngine; public class ChaseObstacle : MonoBehaviour { private void OnCollisionEnter(Collision collision) { if (collision.gameObject.CompareTag("Player")) { FindObjectOfType().GameOver(); } } private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { FindObjectOfType().GameOver(); } } }