Jump to content

Fading out emitters particles


Recommended Posts


I'm trying to do simple explosion with emitter. I want particles to slowly fade out so I do:

emitter.setAlpha(0.2, 1, 10, Phaser.Easing.Linear.None, false);
emitter.autoAlpha = true;

But when i run game and emitter start doing it's job it throws at the console:

Uncaught TypeError: Cannot read property 'v' of undefined
    at Phaser.Particle.update (phaser_phaser_1.js:99052)
    at Phaser.Particles.Arcade.Emitter.update (phaser_phaser_1.js:99548)
    at Phaser.World.Phaser.Group.update (phaser_phaser_1.js:33716)
    at Phaser.Stage.update (phaser_phaser_1.js:31820)
    at Phaser.Game.updateLogic (phaser_phaser_1.js:36338)
    at Phaser.Game.update (phaser_phaser_1.js:36280)
    at Phaser.RequestAnimationFrame.updateRAF (phaser_phaser_1.js:61979)
    at _onLoop (phaser_phaser_1.js:61962)


What am I doing wrong with this task?


Solved - it seems like I set too low alpha rate parameter (third param. in setAlpha).

I misunderstood how it works. Now I get it. If I set rate as 1500 ms particles will fade out in this time. It works now.

Link to comment
Share on other sites

  • 1 year later...

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...