- Home /
Scale only newly emitted particles after parent scale change
In my platformer game, it's possible to change the size of the player character. The player character also has a particle emission. I set this particle emission to hierarchy scaling, to change the size of the particles along with the players. This works, but changing the scale in this manner immediately scales up all the already emitted particles, which doesn't look so good.
Is it possible to only change the scale of newly emitted particles after a scale change of the parent object, and leave already emitted particles as they are? I suppose I could use two particle emitters and turn them on and off as needed via a script, but I was wondering if it can be done with a single particle system.
Answer by richardkettlewell · Aug 11, 2019 at 06:50 PM
You’ll need to do this with some scripting.
Firstly, set the scaling mode to Local or Shape, to avoid already emitted particles from changing when the parent scale changes.
Next, in script, you’ll want to either:
Do all your emission using scripted Emit() with EmitParams, where you set the size using the parent scale
Emit normally, and use Get/SetParticles in LateUpdate and check the lifetime and only modify the startSize property for particles with a lifetime less than the current Time.DeltaTime
Thank you. That is a bit of a tricky solution, so I'll see if I use that or the dual emitter version, but it answers my question.
Your answer
Follow this Question
Related Questions
Particle Scaling for Particle-UI-Elements 0 Answers
Particle System Scaling - Not working for velocities 2 Answers
How can I scale a particle system? 2 Answers
Particle scales with camera distance 3 Answers