Sign in to follow this  
i.wnek

Fading out emitters particles

Recommended Posts

Hello!

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?

Edit:

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.