How can I change the color value of ParticleSystem component

Hi everybody
How can I change the color value of particleSystem component using script ?

Hi @hoanguyen,

Check the following thread, it’s old but I think this holds true to day. Particles use a pc.CurveSet for coloring so it’s a bit more complex than setting a single value:

https://developer.playcanvas.com/en/api/pc.ParticleSystemComponent.html#colorGraph

1 Like

Unfortunately I want it to change over time. Is there any other way to achieve this?

I am not sure that’s doable without a performance hit, since each color change requires recreating data for the emitter.

But the color curve set in editor allows you to have a different color from start to end of the particle lifetime, wouldn’t that work for you?