Smoothly start and stop particles

Basic issue:

I have a bunch of particles frozen in space by setting particleEmitter = false;

When re-enabling the particleEmitter (“un-pausing the particles”), I want them to gradually accelerate to their original speed and continue on course.

Current setup:

I am using a legacy Mesh Particle Emitter to emit particles inward from a sphere mesh.

The particles look like stars, and the effect I am achieving:

  1. Emit particles for several seconds to fill the screen with particles that look like stars.
  2. Set particleEmitter.enabled = false; This freezes the star particles in space, and it looks like a typical photograph of a starry sky.
  3. Now, I want to simulate a camera “zoom out” through the stars. To achieve this, I set Time.timeScale = 0f; particleEmitter.enable = true;
  4. In the Update() function, Time.timeScale += .001f; to gradually raise back to Time.timeScale = 1.0f. This effectively makes it look like the particles gradually accelerate back to their original velocity.

This setup works pretty well, EXCEPT for a problem occurs in Step 3: Its seems like after re-enabling the particleEmitter, even though Time.timeScale is set to zero, the particles retain their original speed for a single frame, causing a notable jump in the particle animation.

tl;dr

Even if Time.timeScale remains set to zero, re-enabling the particleEmitter on a legacy Mesh Particle Emitter allows particles to retain original velocity or movement amount for a single frame, which causes a jump in motion.

Is there some workaround, like setting each particle’s velocity to 0 and then increasing it again?

I think you need to create a for loop accessing all particles and their speed value.
Because if you freeze time, you don’t remove their current velocity value, it will be the same and can only be changed in the next frame.

So what’s happening is when you speed up your time again, the particle system will already have calculated the current velocity and thus the distance and location for the next frame coming. That is what is causing your stutter.