Game Development Community

CountOnDeath with Spawn area with velocity random

by Christopher Ellis · in Torque Game Builder · 03/09/2009 (10:19 am) · 2 replies

I'm trying to use the CountOnDeath behavior to keep a score when an enemy dies. That part is working correctly, however whenever a new enemy is cloned with clonewithbehaviors through the "spawn area with velocity random" behavior the score goes up also.

Any idea why this happens, how to fix it, or how to work around it?

Thanks.

#1
05/19/2009 (8:46 pm)
We're having the same issue. Would love to figure it out!
#2
05/20/2009 (4:45 pm)
This seems to be a common question that keeps coming up. I believe you are both doing the asteroids tutorial, if so what I did to make it work was:

in the scorePoints behavior, change it from onRemoveFromScene to onRemove.

Do the same with the spawnTracker behavior, this should fix your problems.

This will also fix the level issue. I would post my behaviors but I made so many changes it might just be too confusing, then again maybe all the changes I made with the two mentioned above is what fixed it. Let me know I might edit the tutorial or post my source.