Hello, I’m getting a stack overflow when the main base is destroyed. I don’t know why it’s happening now if it’s something I may have changed or if it was corrected in a video and I missed it.
I see why, I’m wondering if it’s something I missed in the lectures.
For now, I’m just going to make a bool in the health script that if true (that it’s the unitbase), it will return so it doesn’t try to damage itself when it’s already being destroyed.
I added the bool baseBuilding return and no longer get the stack overflow.
By the look of it, this line is being called by the UnitBase to make the health 0 on the gameobject that is already being destroyed by the the Unit base