public void UseActionButton() { if (usableItem != null) { if (usableItem is HealthPotion) { GameObject.Find("LocalPlayer").GetComponent <PlayerRpg>().UseHealthPotion(((HealthPotion)usableItem).healthAmount); originalItem.ChangeQuantity(originalItem.GetQuantity() - 1); if (originalItem.GetQuantity() == 0) { originalItem.DestroyObservers(); inventory.ClearSlot(originalItem.itemX, originalItem.itemY, 1); Destroy(originalItem.gameObject); //Destroy(copiedItem); } } } }