void OnTriggerEnter(Collider collider) { Inventory inventory = collider.GetComponent <Inventory>(); if (inventory != null) { if (craft.MakeItem(inventory)) { Transform newCiderBlock = Instantiate(cider, spawnLocation.position, spawnLocation.rotation); newCiderBlock.name = cider.name; } } }