Particle candy

at the moment i am experimenting with particle candy and i have ran into a couple of problems. I am trying to create a function were i am trying to remove a particle when it touches/ falls on another particle, here it is. I cannot get this to seem to work so please help me!.

 local function  Collision(event)         phase = event.phase                  if phase == "began" then         AsteroidParticles:removeSelf()--Asteroid particles is the name of the particle                      end         end        cartBody:addEventListener("collision",Collision)  --cartBody is the object that is listening for the collision, so when the asteroid touches the object it disappears  

Hi @harryjnewton,

I’ve moved this topic to the Particle Candy sub-forum, so it’s more focused and you should get the assistance you need.

Best regards,

Brent Sorrentino

thanks so much Brent, helps a lot

From what I recall, to delete a particle if using Particle Candy you are _not _supposed to use removeSelf().  The “officially” recommended way is to set the killTime to the current time and thus Particle Candy will automatically remove it.  Like so:

event.target.killTime = system.getTimer()  

If that doesn’t work you can also try setting the particle scale to smaller than .001 since Particle Candy automatically removes any particle smaller than that, like so:

event.target.scale = 0.0001  

That is how I do it and it works for me.

Hi @harryjnewton,

I’ve moved this topic to the Particle Candy sub-forum, so it’s more focused and you should get the assistance you need.

Best regards,

Brent Sorrentino

thanks so much Brent, helps a lot

From what I recall, to delete a particle if using Particle Candy you are _not _supposed to use removeSelf().  The “officially” recommended way is to set the killTime to the current time and thus Particle Candy will automatically remove it.  Like so:

event.target.killTime = system.getTimer()  

If that doesn’t work you can also try setting the particle scale to smaller than .001 since Particle Candy automatically removes any particle smaller than that, like so:

event.target.scale = 0.0001  

That is how I do it and it works for me.