Game Development Community

Death animation not playing

by Felix999 · in Torque Game Engine · 05/31/2008 (4:59 am) · 3 replies

I'm new to torque and torque script, so i went through the codesampler.com tutorials.
I'm on the last one now(weapon damage) and I'm having a bitof trouble.
The player_dieknees animation doesn't play when i kill the bot with the rocket launcher. It just freezes in whatever position it was when i killed it. I went through the tutorial a few times, but each time the same thing happens. Any help would be much appreciated.
Thanks.

#1
06/20/2008 (10:43 am)
Are you getting any console errors? I have the same problem.

Check this link

www.garagegames.com/mg/forums/result.thread.php?qt=16022
#2
06/21/2008 (3:26 pm)
Hey Infinitum3D,
thanks for the reply

i get the following console error:
unable to find object: '' attempting to call function 'onDeath'

i've also tried running the animation from the console as described in the link you posted,
i used the following command:
%Player.playThread(0, "die");

i got the following error when i tried this:
(0): Unable to find object: '' attempting to call function 'playThread'
#3
06/27/2008 (11:01 am)
Yeah, I had the same problem.

Is this a custom animation, or a stock TGE .dsq?
Does your death animation work in show tool?

Look at the thread Torque 101: Intro to Torque around post #130 (the ones for June 2008). I can't remember exactly how I got past it, but I did get it working.

The onDisabled function is supposed to playDeathAnimation, and the playDeathAnimation function selects from a lst of different death animations. Make sure that the number of death animations matches the deathIdx++> number otherwise it won't play the death animation at all.

My rat has 2 death animations, so I had to make the deathIdx++>2

also, define the correct number of animation variables

$RatDeathAnim::Death1 = 1;
$RatDeathAnim::Death2 = 2;

Hope this helps. If not, let me know

Tony