So I have a script, which I will only share a small part of, but basically when this function is called I want it to delete all the objects with the tag “ground” and then once those are deleted, I want it to debug “done deletin’ shiz”. Here’s the function:
void DestroyLevel(){
GameObject[] dungeons = GameObject.FindGameObjectsWithTag("ground");
foreach (GameObject col in dungeons){
Destroy (col);
GameObject dungeon = col;
if (dungeon != null){
Debug.Log ("Still deletin' " + dungeon);
}
else {
Debug.Log ("Done deletin' shiz");
}
}
}
When I do this, I just get “still deletin’ _” a bunch of times but I never reach “Done deletin’ shiz” which is my goal. Any idea what is wrong with this script, I feel like I have tried everything but maybe I’m being an idiot. Any help is appreciated.