So I wanted to make another for loop to destroy my blocks one at a time after others have been made

Just to start, make sure when posting code on the forums that you use code tags , as this allows people to read your code a lot easier.

My guess is that your public GameObject block; is in fact not a GameObject that resides in your Scene, but a Prefab which is in your Assets folder.

From your code, it looks like you’re trying to Destroy the wall that you previously created? If that’s the case, you would want to loop through blockList and Destroy those, not block.

// it makes more sense to loop through blockList.Count, so that it will Destroy everything, not just the first 5 elements.
for (int i = 0; i < blockList.Count; i++)
{
    Destroy(blockList[i], 0.2f);
}

// we want to clear out the list after we Destroy all the blocks
blockList.Clear();
1 Like