ParticleSystem - changing particle's remainingLifetime breaks it's phase

Originally posted here - Use ParticleSystem to generate permanent objects - problem with velocity phase

Reposting since there were no replies in the other subforum…

Basically, if I happen to update remainingLifetime of particles in a loop (once), their phase (which affects Velocity over Lifetime, Speed over lifetime, etc) becomes equal, as if they were created at exactly the same time.

Bug? Expected? Workaround? My aim is to generate a specific amount of everlasting particles. I can do this via setting initial lifetime to 100000 but this slows down Unity when Prewarm is used (which is necessary - I need all particles be generated before the 1st frame). So I tried to increase remainingLifetime via code on 1st frame), but got unexpected result.

Perhaps multiply startLifetime by the same ratio as your adjustment to remainingLifetime, to preserve the “percentage through life” that all these curves use.

1 Like

Thanks Richard, will try and report back.

1 Like

That worked, thank you!

1 Like

Hijack this thread…i think my question is related…

I want to get the remaining percentage of particle life as a value. i don’t understand why this doesn’t work?

“particlelifePercentageRemaining = particles_.remainingLifetime /particles*.startLifetime;”*_
Does anyone know the correct way to get the percentage of remaining life of a particle?