I have a code that creates a flash when certain object ceases to exist. For that purpose I used OnDisable()
The problem now is that when I stop the game, I get many flash(Clone) all over my scene, and I have to erase them manualy. Can I fix this issue?
Debug lets me knows that “Some objects were not cleaned up when closing the scene”
How do I clean these cloned objects automaticaly?
Here’s the code
var flash : Transform;
function OnDisable()
{
Instantiate(flash,transform.position,transform.rotation);
}