- Home /
particle system will play only once
Hi everyone,
This may sounds like a very basic question, and there is obviously something I don't get right, but despite my researches in docs, tuts and forums, I can't find any solution.
So, let's use a very simple example: create a new 2d project, add a default particle system and uncheck its "looping" property. Now, hit play. PlayOnWake is checked, the particle system will play once, no problem with that. Now select the particle system in the hierarchy. If you click the "simulate" button in the game view, it will play once again. And that's it, it will never play again, whatever you click on. This is the simplest example, but actually what I'm trying to achieve is playing and stopping the particle system on demand through scripting (Play() and Stop() methods). I can't get the expected result, and yes, I tried setting the ParticleSystem.emission.enabled variable.
Obviously, this is the intended behaviour, and there's something I'm misunderstanding. I'm using Unity 5.3, I tried a lot of things, and I'm really getting desperate. :( Any ideas? :)
Answer by mgsteinkamp · Jan 07, 2016 at 05:51 AM
In the meantime, a workaround is to add something like :
ParticleSystem sys;
sys.startLifetime = sys.startLifetime;
It's meaningless code, but it's the only thing I found that would allow the system to work again. Just add it after your "Emit" call.
You are a life saver. This seems to fix the problem for me as well.
This should be flagged as the real answer. At least, it was the most helpful.
Your answer
Follow this Question
Related Questions
how to change the size of a particle 0 Answers
make particles move in world space 1 Answer
Can you change the Velocity Over Lifetime of a Particle System using a Script? 3 Answers
How do I make instantiated particles inherit Transform movement from their parent object? 1 Answer
Shuriken particle System - change velocity by trigger 0 Answers