3DPlatformTutorial object instantiation

I’m studying Unity by 3DPlatformTutorial.
“LaserTrap” script instantiates sfx if laser beam collides with player or robot. It’s done by codeline as follows:

Instantiate(hitEffect, hit.point, Quaternion.identity);

So the return value on this call is not retained.
On debugging, I can see that “LaserHit(Clone)” object appears for a short while in a Hierarchy.

My question is: how is instantiated hitEffect destroyed? Why there’s no memory leak here in?

I don’t have the tutorial but I think the Effects gets destroyed by another script which is attached to the hitEffect.

In this script should stand something like this:

Destroy (gameObject, destroyTime); // destroyTime is in this case just an integer variable.

Hope this helps.

Thanks for your effort, ExTheSea.
I found out that “auto-destroy” is achieved by checking “Autodestruct” checkbox in the “Particle Animator” component. Hope it may be helpful for someone…