True seamless ParticleSystem looping

Hello,
Is there a working way to achieve seamless looped particles with PS? I mean like for static particles that should keep their positions between simulations of the particle system.

I HAVE ALREADY TRIED:

  • turning off auto random seed
  • resimulating/clearin/stoping&playing when simulation time reaches its end.

This seems a serious issue to me. I am using U 5.4.3

Best!

In scripting, you can set your particleSystem.randomSeed. I know the name is deceiving, but if you set that value to the same number, it will simulate the same way each time.

A particle system always starts with a random seed. Setting “autoRandomSeed” to true simply disables it from getting a new random seed each time Play() is called.

Thanks, but that does not work at all, as I’ve written, I’ve already tried that.

Can you provide an example of what you are trying to achieve? Maybe a project file?

We have an issue similar to this.
Particle System is Looped, but not Prewarmed (Smoke rising slowly from a chimney)

Start ParticleSystem, save time to effectTime.
Move Camera far away → Stop particle System
Move Camera Back → ParticleSystem.Play and set ParticleSystem.time to Time.time - effectTime
Particle System starts from the beginning (because it’s Looped?) instead of at Time.time - effectTime.

Sounds like you want to use Simulate, not time. https://docs.unity3d.com/ScriptReference/ParticleSystem.Simulate.html
Record the time, call stop and use Simulate with that time to resume it.

1 Like

Thanks a lot! That does the trick, my code snippet for anyone else trying to do it

var time = Time.time - chimneyStartTime;
chimneyEffect.Simulate(time,false);
chimneyEffect.Play();

Any idea how efficient the Simulate function is? For example if I have the effect running for 10 min and want to restore it, will it be costly to call Simulate with a high t? The particle system duration is 8 sec looped with particle lifetime of 10 sec. Then again I can probably just consider any t higher 10 as 10. It will not be a perfect restore but not noticeable in my case.

1 Like

It could be quite costly if its a none procedural system. https://blogs.unity3d.com/2016/12/20/unitytips-particlesystem-performance-culling/

1 Like

Thanks guys! Will try that approach!