Particle following emitter

Hi BJS Community,

I made this playground where the particles are strictly following the sphere emitter movement thanks to a specific updateFunction: https://playground.babylonjs.com/#MRRGXL#913

Then I have this other playground with particles using another texture and blend mode set to BLENDMODE_ADD: https://playground.babylonjs.com/#MRRGXL#914

If I want to have both it just doesn’t work: https://playground.babylonjs.com/#MRRGXL#915

Somehow BLENDMODE_ADD is not compatible with a custom updateFunction.
I tried to have the same particle effect while keeping BLENDMODE_ONEONE but got no result.

Can you help me figure that out and make it work?
Thanks :hugs:

Hello

I don’t know exactly why, but I guess there is something to do in the updateFunction when using this blend mode, which is no longer done due to the override.

Saving the old update function and calling it actually solves this (line 79 & 81)

I guess a closer look at the source code should put some light on this :slight_smile:

2 Likes

Perfect thanks @Tricotou !