Game Development Community

Help with collison code

by Danny Mejia · in Torque Game Builder · 12/20/2006 (3:15 pm) · 1 replies

I have an anim sprite that need to delete when hit my the player missile. But the missile will not delete. Here my code:

function playerMissile::onCollision( %srcObj, %dstObj, %srcRef, %dstRef, %time, %normal, %contactCount, %contacts )
{
if(%dstObj.class $= "cometShip")
{
//blow up the missle
%srcObj.safeDelete();
}
//blow up the comet
else
{
%dstObj.explode();
}
}

Is this because I have an anim Sprite?

#1
12/20/2006 (6:26 pm)
Place an echo("test"); command in your decision statement. It's possible %srcObj.safeDelete(); isn't even being called at all.