using System.Collections; using System.Collections.Generic; using UnityEngine; public class BlueCheeseCollect : MonoBehaviour { private int Cheese = 0; private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Cheese")) { Destroy(collision.gameObject); Cheese++; Debug.Log("Cheese: " + Cheese); } } }