How to play partical effects using script?

Hello, I’m new to unity and I’m trying to add some particle effects when the player dies, I’m able to play the effect but the particle keeps looping, to play the effect I simply have a variable for my effect:

“public ParticleSystem explosion;”

and I play the effect using:

“explosion.Play();”

How do I fix this problem, tell me if you need more info on the script, and yes my particle effect does not have the looping property on.

I resolved the issue, for anyone wondering I just used a IEnumerator to do:
“explosion.Stop();”
witch stopped the explosion.

Can you please ask on the scripting forum in the future as this is the 2D forum and as such has nothing to do with the particle system or generic scripting issues.

Thanks.