Can't remove from list

I have a nation class and a war class and the nation class has a list. I have a script with two different nations yourNation and selectedNation. I have this code in the script, and it isn’t part of a loop.
yourNation.Wars.Remove(selectedWar);
selectedNation.Wars.Remove(selectedWar); For some reason this script causes unity to freeze and my ram usage to go up until my computer crashes. If I add a // in front of the first line of code, the problem goes away, even if the second is still on. Why is this happening?

Great question… Hopefully someone here is telepathic and can see your script!!

Review the first post in this forum for how to properly format your code for posting.

I’m so sorry, I got cut off while writing this, then completely forgot about it. Regardless, I found another way to get the same effect that I wanted. Sorry for the terrible question.

1 Like