So i have this gameobject thats a simple go with a sprite renderer that i use to display where you can cast a spell in a grid. When you click on an ability i instantiate multiple times that gameobject and then place them around on the grid so you know what the area of effect of the ability. I also use them in object pooling no to instiante all the time.
Problem i have is that for some reason the first i click play everything works fine. If i press play again to stop unity it seems the gameobject that is used to instantiate gets garbage collected or something because the next time i press play and instantiate from that object its all broken, i debugged and looked at lets say its transform and its a null ptr exception. So between play in the editor the game object gets disposed but i still have a reference on it and then when i instantiate anything from it its already broken. Anyone has any idea how that would be possible ? I do not have any code that calls dispose or destroy on that gameobject or on any of its copies, the only thing i do is SetActive(false) on the copies.