[SOLVED] Resetting a particle system

I am using particlesystem.play() to display a particle system which is not set to autoplay

I thought that using particlesystem.reset() would reset the particle system but instead it causes it to play again!

So I tried particlesystem.stop() before the reset() but that had no effect either.

What is the correct way to reset the particle system so that it can be triggered again by another particlesystem.play() ?

stop finishes playing, and then stops emitting.
If you need first clear it, then have you tried first calling reset and then stop?

Experimentation - is a key.

ok, i tried that, still doesn’t fire a second time around

It has to leave trigger first. In order to trigger it again.

I am not sure what you mean by that, could you elaborate a bit, thanks.

triggerenter fires only when rigidbody enters trigger volume, then it wont fire, until rigidbody is out of that trigger volume first.

Hi max , I think you might have confused this topic with another one. I am not using triggers to fire the particles just simple script communication

Just to clarify

What do you do after plarticlesystem.play so that plarticlesystem.play can be used again

I figured it out in the end.
In order to fire the particlesystem manually you have to do particlesystem.reset() immediately before particlesystem.play()

i.e instead of

particlesystem.play();

its

particlesystem.reset();
particlesystem.play();

that way it will fires as many times as you need it to.

Is particlesystem.play() after particlesystem.reset() needed if you don’t stop it by that time? Just curios, what exactly was your problem? It’s not pretty clear.

I understand you fixed it, but clarifying it a little may help other people.

EDIT:

I see that Docs are saying “Resets particle state, doesn’t affect playing.” for the reset() function. Doesn’t this mean that it, well, resets it without stopping? Shouldn’t resetting while running just do what it’s called, without the need of play()?

Hi,
I will try to explain my initial problem.

I was showing a particle display once the player won the game.
When the player started the game again I noticed that the particle display didn’t fire the second time the player won.
After a bit of trial and error I discovered that called particle.reset() directly before particle.play() would have the required effect of it playing evertime the player won.

Later I discovered that it was mentioned in the documentation on the particle system but I had missed it.
See the very bottom of this page
http://developer.playcanvas.com/en/user-manual/graphics/particles/