Fade particles

hey, I got a question related with scripting.
I am using your script fade particles, but when I am trying to add more than one emitter on the script doesn’t work for me, i think I am doing something wrong. if you can help me with this will be appreciated it.
I am attaching a screenshot.

thank you in advance …!

You are reusing variable names!! That’s a big problem, you are not getting different emitters, you are redefining the variable. On top of that, const can’t be redefined (it’s constant).

Also .find() was deprecated, you have to use .findFirst() and Promises

1 Like

As Thomas said, it’d be best to update the code to use promises, but to solve your current issue you just need to rename your constants :
const emitter0 = Scene.root.find(‘emitter0’)
const emitter1 = Scene.root.find(‘emitter1’), etc…

You’ll also likely have to copy paste those two last lines for every const so :

emitter1.hsvaColorModulationModifier = alphaSampler
emitter1.sizeModifier = sizeSampler
emitter2.hsvaColorModulationModifier = alphaSampler
emitter2.sizeModifier = sizeSampler

and so on for all the emitters

1 Like