How to change particle emitter size via script? (SOLVED)

Hi Everyone. I’d need to change the size of an emitter via script. I can’t find anything that allows me to do that in the documentation.

Also, if I change the scale properties of the game object that contains the particlefx, this has no effect.

I’m using Defold 2.0 and fixed_aspect_ration.render ( https://github.com/britzl/publicexamples/tree/master/examples/fixed_aspect_ratio ).

Any idea?

Thanks

Particle effect properties can’t be changed at run-time I’m afraid. Perhaps you can have multiple particle effects of varying size and only enable the one that has the desired size?

It is also weird that the particlefx emitters do not scale automatically like all the others objects.
However, your suggestion is doable and I’ll probably go for it.

Thank you

1 Like

Are you scaling the parent game object uniformly? Particlefx need to be uniformly scaled and in the case of a non-uniform scaling vector the smallest element will be used for setting the scale.

3 Likes

That was exactly the issue. I was scaling just x and y, thinking it would have ignored z. Using the same scale values for x, y and z, even if it is a 2D particlefx, works perfectly.

Thank you very much.

4 Likes