// CollectablePot.cs using UnityEngine; public class CollectablePot : MonoBehaviour { public string playerTag = "Player"; // Tag your player GameObject with "Player" void OnTriggerEnter2D(Collider2D other) { // Check if the object that entered the trigger is the player if (other.CompareTag(playerTag)) { // Tell the PlayerInventory that the pot has been collected if (PlayerInventory.Instance != null) { PlayerInventory.Instance.CollectPot(); } else { Debug.LogError("PlayerInventory instance not found!"); } // Make the pot disappear (or play an animation, sound, etc.) gameObject.SetActive(false); // Simplest way to "remove" it // Or you could use: Destroy(gameObject); } } }