using System.Collections; using System.Collections.Generic; using UnityEngine; using _Game.Scripts.Player.PlayerAttacks.Earth; public class DestroyObjectByEarth : MonoBehaviour { void OnCollisionEnter2D(Collision2D other) { if (!other.gameObject.CompareTag("Player")) return; if (other.gameObject.GetComponent().isStomping) { Destroy(gameObject); } } }