[SOLVED] particle is not removed ?

Posted By: Reconnoiter

[SOLVED] particle is not removed ? - 05/17/17 13:58

Hi,

I am not sure why but for some reason particles are not removed after time (/lifespan does not do anything), here is the code:

Code:
function spawnParticle (PARTICLE* p) {
	p.bmap = ui_cursor; //just testing
	p.size = 3;
   p.alpha = 100;
   p.lifespan = 2;
	vec_set(p.blue, vector(255, 255, 255));
   set(p, MOVE | TRANSLUCENT); //BRIGHT | 
}
...
effect(spawnParticle, 1, ent.x, vector(0,0,20));

Posted By: Aku_Aku

Re: particle is not removed ? - 05/17/17 17:03

What if when you create only one particle?
Posted By: Superku

Re: particle is not removed ? - 05/18/17 02:30

Add
p.event = NULL;
to your spawnParticle() function. Otherwise, that same function or event would be executed for the same particle(s) each frame, continously resetting lifespan to 2.
Posted By: Reconnoiter

Re: particle is not removed ? - 05/18/17 09:48

Originally Posted By: Superku
Add
p.event = NULL;
to your spawnParticle() function. Otherwise, that same function or event would be executed for the same particle(s) each frame, continously resetting lifespan to 2.
, tnx that was the indeed the problem.
© 2024 lite-C Forums