using UnityEngine; public class DeadZone : MonoBehaviour { private void OnTriggerEnter2D(Collider2D other) { if(other.GetComponentInParent() != null) { PlayerController p = other.GetComponentInParent(); p.TakeDamage(9999999); } } }