Game Development Community

setEffectLifeMode("KILL", 1.0);

by Kevin James · in Torque Game Builder · 05/24/2010 (6:49 am) · 2 replies

I always assumed "KILL" would kill (as in delete) the effect when it was done. Apparently that is false since this actually does something:

function t2dParticleEffect::onStopEffect(%this)  
{  
   %this.safeDelete();  
}

I had a ton of effects that have been floating around (possibly) killing performance because "KILL" was really "STOP".

About the author

Computer security, digital forensics, and platform jumper enthusiast. shells.myw3b.net/~syreal/


#1
05/24/2010 (8:00 am)
From my experiments, it looks like "Kill" only removes the particles; not the actual t2dParticleEffect - which is important if you have things like particle collisions going and such.

My intent with deleting it from the callback was to delete the actual t2dParticleEffect since I create them dynamically whenever I need a particle effect.

Bueller? Bueller?
#2
05/24/2010 (8:50 am)
Same here. The documentation says this:
KILL: The effect will delete itself once the Effect Lifetime elapses.

Which is not exactly true.