How to disable/remove preFX or sprite effect?

const sprite = this.add.sprite();

sprite.preFX.addGlow();

I dont know how to disable it, sprite.active = false; doesnt work.

Any help?

If you want to turn it on and off:

const glow = sprite.preFX.addGlow();
// …
glow.active = false;

If you want to remove all pre-effects:

sprite.preFX.clear();
1 Like
const glow = sprite.preFX.addGlow();

sprite.preFX.remove(glow);
2 Likes