Clearing Particle Candy Particles

Blitz3D Forums/Blitz3D Programming/Clearing Particle Candy Particles

I occasionally need to destroy every active Particle Candy Particle. When I do, I call a function which does this :


Function Clear_All_Particles()

   DebugLog "CLEARING PARTICLES"
   ClearParticles()
   UpdateParticles()

End Function



Now weird thing.. sometimes it works, sometimes it doesn't. Sometimes everything clears and is perfect. Sometimes I get a bunch of static particles ( because I stop updating them.. they're not supposed to be there. )

Any ideas?

That should do it. Bug with Particle Candy maybe?

Try emailing the author if something's up because I'm a registered user too but I haven't got around to using it yet in my project.

Thanks guys, thought I was doing it right. I've emailed the author to see what he thinks.

Anyone else have this issue or see any potential solutions? I've emailed the author, but no reply in a week.

Did you manage to resolve your problem?

Possibly. I left it after emailing the author, because I figured he'd be able to find the problem a lot quicker than I would.

I've gone back to it today, and made a couple of changes. It's working at the moment, but since the bug was random, I can't be 100% sure it's solved.

Function Clear_All_Particles()

	DebugLog "CLEARING PARTICLES"
	Emitters_Stop()
	ClearParticles()
	UpdateParticles()
		
	; NEW ADDITION
		
	ClearSurface PTSurf(0)
	ClearSurface PTSurf(1)

	; / NEW ADDITION
		
End Function