I am having a really annoying problem right now. Basically what i want to do is when i pick up an object it will pass (item) through a series of functions to place it into my inventory before ultimately being assigned to a slot, this is assigned as
public void setItem(Item i)
item = i;
The problem is when i destroy the object that this item script is attached to it blows up the reference to it too.
I would like to know if there is a function of sorts that will copy the object instead of just referencing it.