[SOLVED] Particle system runs in Edit Mode but not in Play Mode
I'm posting this in the hopes it would help someone in the future (spent over 4 hours on this).
Problem: my particle system works ok in Edit Mode but spawns no particles in Play Mode. Also when selected in Scene view during Play Mode and after hitting "Play" on the particle system window nothing happens.
Solution: in my case it was a problem with my code in which I used ParticleSystem.GetParticles() and ParticleSystem.SetParticles() calls in every LateUpdate. The problem was in the ParticleSystem.Particle[] array that is passed into GetParticles() and SetParticles(). I did not initialize it and it had a null value.
Now, in most other cases this mistake would give you a NullReferebceException, but not in this case. I'm guessing this is because of how this methods are built internally for optimisation reasons. So what my code was essentially doing was killing all particles every frame update. It would have been nice I Unity issued some sort of warning when I'm doing such nonsense ;-)
Hope it helps somebody in the future.
Your answer
![](https://koobas.hobune.stream/wayback/20220612163406im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Are there any disadvantages to using the legacy Ellipsoid Particle System in Unity 5 over Shuriken. 0 Answers
Particles emited from bellow the cone base shell 2 Answers
Start collision detection of particles after certain time 0 Answers
How to trigger VFX particle 0 Answers
Coding a Sine / Cosine Wave for the Particle System 1 Answer