I have a couple of objects that spawn a particle effect, when they are destroyed. Everytime I start the game from within Unity and then stop it, each object I have not destroyed during runtime spawns his death-effect and these linger in my hierarchy. Is there a way to prevent this from happening?
Script:
function OnDestroy() {
Instantiate(object, position, rotation);
}