Alrighty, so I’m kind of new to unity, and I’m not sure what exactly is going on. But my issue is:
I have a prefab named UnitStack (it’s an object that contains up to 8 units in a list and gives me extra functions to use the group). Well, if you want to remove a unit from the UnitStack but share the space with no alternative stack, I need to create a new one. In my script I added:
public UnitStack unit_stack;
Then in the editor I associated that to my prefab for a UnitStack. My problem is that when I call instantiate and reference unit_stack, it instantiates a copy of my current stack. So instead of removing one unit into a new stack…it recreates the entire stack and then adds the unit to it, so there are way too many units in the new stack.
Why is my Instantiate creating a copy of my current UnitStack game object instead of a fresh empty one?