public void Discard() { if (CurrentItem != null) { Transform player = GameObject.FindGameObjectWithTag("Player").transform; GameObject discardBox = Instantiate(discardBoxPref, player.position + player.forward * 2f, Quaternion.identity); InventoryController boxIC = discardBox.GetComponent <InventoryController>(); boxIC.ChangeCapacity(1); boxIC.Insert(CurrentItem, 0); } CurrentItem = null; Hide(); }