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:
- Emit particles for several seconds to fill the screen with particles that look like stars.
- Set
particleEmitter.enabled = false;
This freezes the star particles in space, and it looks like a typical photograph of a starry sky. - Now, I want to simulate a camera “zoom out” through the stars. To achieve this, I set
Time.timeScale = 0f; particleEmitter.enable = true;
- 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?