Game Development Community

Leaked particle effects

by Nicolas Stohler · in Torque Game Builder · 04/06/2006 (12:03 am) · 2 replies

I attached a particle effect to my shots using the attachThruster function that is described in the basic tutorial. The effect plays, and does vanish as soon as the shot collides with something (effect is mounted on the shot), I experience a very hard performance loss after some shooting around. When I turn the debug banner on, I see that for every shot I fire, two objects get generated (shot + effect), but as soon as there's a collision, only one object (shot) gets deleted, the effect somehow stays in the scene (but not visible anymore). I removed the call to attachThruster and there were no more leaked objects!

when I mount the effect so that the parent(shot) does not own the mounted object, and use setEffectLifeMode( KILL, 0.5 ) on the created effect, no leaks happen too, but this does not look good, cause the effect will stay on screen evem if the shot already has been deleted.

am i missing something here (layers/groups/...)?

#1
04/12/2006 (9:00 pm)
Is the effect mounted to the object?

if not, try mounting, and it should die when the parent dies
#2
04/12/2006 (9:29 pm)
That's the problem, it really is mounted!

- visually, it dies...
- but in the debug banner, the object count goes up and up... which might not be a problem for games that spawn particle effects every now and then, but in my case, it makes the game unplayable (framerate < 60 fps) in under 10 seconds

see here