Melee respawn
by Josiah Trumpower · in Torque Game Engine Advanced · 11/06/2009 (12:35 am) · 3 replies
Ok, so I am making the AI player melee me by collision. It will hurt me but when I die I don't respawn. However, if he shoots and kills me, the I will respawn. This doesn't make much sense. Can someone please tell me why I am not respawning and how to fix this problem? sorry I am using TGEA but don't know how to delete this thread and don't want to double post. So if you could reply as if this was in the TGEA forum.
About the author
#2
function AIplayer::onCollision(%this, %obj, %col)
{
if(%col.getClassName() $= "Player" && obj.getState() !$="dead") // Check to see if we are colliding with player[/b]
{
%this.playThread(0, "damageAnim"); // Animate AI unit[/b]
%col.applyDamage(500); // Hurt the player[/b]
}
else
{
return;
}
}
11/06/2009 (1:52 am)
This is the code for the damage. I want to take damage, not do damage to him. It works, but when he kills me I can't respawn.function AIplayer::onCollision(%this, %obj, %col)
{
if(%col.getClassName() $= "Player" && obj.getState() !$="dead") // Check to see if we are colliding with player[/b]
{
%this.playThread(0, "damageAnim"); // Animate AI unit[/b]
%col.applyDamage(500); // Hurt the player[/b]
}
else
{
return;
}
}
#3
11/13/2009 (1:19 am)
bmp
Associate Scott Burns
GG Alumni
Are there any errors in the console log? You might want to check how you're killing him via collision versus how it works via weapon. It could be there's an important command you've overlooked. It's kind of hard to say without seeing the code.