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:
Hello,
I am doing something like this to change in code the color of a ParticleSystem.
this.entityParticleEngine.particlesystem.colorGraph.curves[0].keys[0][1] = 0.2;
this.entityParticleEngine.particlesystem.colorGraph.curves[1].keys[0][1] = 0.2;
this.entityParticleEngine.particlesystem.colorGraph.curves[2].keys[0][1] = 0.85;
It works correctly if I do this during initialization. But on runtime, in the update(dt) function, it doesn’t affect the color. Do we have do some sort of update on …
https://developer.playcanvas.com/en/api/pc.ParticleSystemComponent.html#colorGraph
1 Like