using MontanaJohns.Actors; using System.Collections; using System.Collections.Generic; using UnityEngine; public class BottomlessPit : MonoBehaviour { private void OnTriggerEnter2D(Collider2D collision) { if (LayerMask.LayerToName(collision.gameObject.layer) == "Enemy" || LayerMask.LayerToName(collision.gameObject.layer) == "Player") { if(collision.gameObject.tag == "Player") { collision.gameObject.GetComponent().TakeDamage(999); } else { Destroy(collision.gameObject); } } } }