- Home /
What would be the "next-best-thing" to a ParticleSystem?
I've tried a few things: using mesh, PrimitiveType.Quad, Sprite Renderer, etc) but none of those came even close to ParticleSystem in performance.
Based on this tutorial: https://medium.com/@rafalwilinski/tutorial-particle-sea-in-unity3d-70ff1350fa9e I've found that it is possible to set the position of the particles of a ParticleSystem. However, even that seems to take a considerable performance hit. Also, as the number of particles is increased, beyond a certain number (seems device performance dependent) the particle movement starts jittering.
Overall, a ParticleSystem approach would be acceptable but I'm wondering if there's an approach that has better performance.
Answer by ifurkend · May 06, 2018 at 12:18 AM
Noise has been implemented to the native particle system since Unity 5.5. To simulate that sea of particles, just enable the Noise module, check separate axes, give some strength to y-axis only. You can also enable Color by Speed module, so each particle changes color when it moves in different speed.
Can’t promise to be the same thing, but it’s always preferable to use the built-in modules first before resorting to personal script.
Thank you for the reply. Actually, the Particle Sea tutorial was just an example for moving the particles with a personal script. What I want to do is a magic effect where shapes fly around a character and as I was testing different things, overall, ParticleSystem gave a much better performance than the other things. The only drawback is that ins$$anonymous$$d of "simply" having a list of objects, I have to set up a ParticleSystem. If there isn't any better approach then that'll still be worth it.
You can still get/setParticles in your own script, but the point is, reduce the actual particales you want to manipulate via script. For instancing, have a particle system with low emission rate modified by the script, and use sub emitter to emit more particles not directly affected by the script. You can use inherit velocity to make the sub particles move in the same/opposite initial direction of the spawning particle system.
In Unity 2018.1, radial(orbital) velocity is introduced to the velocity over lifetime module, eli$$anonymous$$ating another demand to get/setParticles.
Overall, wouldn't that approach still be mainly suitable for particles where settings are set before particles are emitted? That is, if I want the kind of particle movement where particles move along a certain path, stop, move again as needed based on other factors in the game, it seems to me that I do that with a script.
On the other hand, I'm sure I'll need other types of particle systems where your tips will come handy.