Hello. I encountered this problem and don’t know why or how to fix it.
I have a cloud spawn script. If the cloud goes beyond the boundaries of the collider, I move it to another point. I’m using the object pool pattern, so I activate and deactivate clouds. The error occurs when exiting the game or changing scenes.
Apparently there is an unnecessary miscalculation.
Help me please.
I can imagine the following scenario: the game object where CloudSpawner line 37 is attached to has just been activated or deactivated from another component’s event methods. This is likely forbidden, to prevent a chain of OnEnable/OnDisable (or other events like OnTrigger) calls bouncing between several gameobject’s components - eventually throwing a stack overflow.
Thank you very much for your answer. I just fixed this error. I used Object Pool, although I never turned off the clouds, so I always turned them on. It was my mistake)