This is a really nooby question and I apologise. What I have is a colony which contains many buildings, they will probably be stored in a list, if I was to press remove building on any building, i’d need to destroy it, so i will have a remove method in the building script that will essentially destroy the building it is attached too…
What i’m wondering is when I do this what will happen to the colonies list of buildings…
Will it automatically remove the object from the list and clean itself up, or will I get errors where it is trying to find object at given index that doesn’t exist any more?
It’s easy to fix it by just using list.remove before doing gameobject.destroy I imagine, but I just want to know for the sake of furthering my understanding for future what I should do.
Thanks guys.