Sign in to follow this  
Asdf

Kill Particle emitter children

Recommended Posts

Hey guys.  I am using a particle emitter in one of my games.  On my sprites death, I am attempting to kill off the emitter's children.  (That sounds wrong)

 

I am using this code:

 

that.emitter.children.forEach(function(fire){

     fire.kill();

});
 
It seems to kill all the particles except one. Any reason why one particle still remains, and any ideas on how I can remove it?
 
Thanks guys!

Share this post


Link to post
Share on other sites

What if you use destroy() instead? Try to pass true as a parameter and it should kill all its children.

that.emitter.destroy(true); 

Will destroy the parent and its children. Work around that code maybe it will solve your problem.

Share this post


Link to post
Share on other sites

What if you use destroy() instead? Try to pass true as a parameter and it should kill all its children.

that.emitter.destroy(true); 

Will destroy the parent and its children. Work around that code maybe it will solve your problem.

 

That worked!  You rock!!!

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.