private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "food") { string itemId = collision.gameObject.GetComponent <Item>().id; // add to bag im.AddItem(itemId); // add 1 item to bag im.DisplayBag(); // destory it for current phase Destroy(collision.gameObject); } }