using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; public class ItemColliector : MonoBehaviour { private int Blue_Cheese = 0; public TMP_Text BlueCheeseText; private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Blue Cheese")) { Destroy(collision.gameObject); Blue_Cheese++; Debug.Log("Blue Cheeses: " + Blue_Cheese); BlueCheeseText.text = "Blue Cheese: " + Blue_Cheese; } } }