How to change Particle FX spawn rate at runtime

Hi everyone, it has been a month now since I started porting an unfinished game from Gideros to Defold. So far pretty straightforward and by implementing OOP using Yaci I managed to keep most of my game logic intact.

Now, coming to the title. The game features a particle emitter behind the main character, during the progression of the story those particle should get spawned more and faster. The progression should be something like:

spawn_rate=game.level*10

In Gideros I could do this by controlling the rate at which this function would be called (it spawns one o more particles in the particles object):

Particles:addParticles(particles)

While searching I came across a couple of threads with the answer that this wasn’t possible yet:


Has this been implemented yet? I think this a really important feature that would make the particles component more powerful and useful.

A workaround I thought might be to make multiple emitters in Play Mode “once” and run them every 1/spawn_rate seconds… I’m thinking out loud, this solution would me a step above what’s considered “hacky”.

Do you have any suggestions?

Crypto

1 Like

I think this would work nicely. The default limit for emitters is 64, which would probably be enough for what you want to do. I can’t think of a better way of doing it!

1 Like