I'm trying to remove every GameObject which meet certain criteria (health<0), completely from every occurrence, so every ArrayList it might be in, and such.
I have a main ArrayList containing every GameObject that may get removed, and I'm trying to iterate through that ArrayList with a For-Each, checking each element for the criteria, and removing it.
This however results in ConcurrentModificationException, which I know the reason to, but do not know how to work around it. Any help would be much appreciated!