Game Development Community

Adding anims

by Nathan Kent · in Torque Game Engine · 01/15/2008 (4:36 am) · 1 replies

I have resently added some code for swimming, and a melee system into my game. The only problem is that I have no clue how to make directional swimming anims (forward, backwards, left, right, up, down, root), and I don't know make the root change depending on if my player has a sword, is in water, or is on the ground. If anyone could help me, I'd appreciate it!

Edit-> I was thinking something like:
if(mIsSwimming)
   anim = "sm" + anim;
else if (mHasSword)
   anim = "h1" + anim;
else
   anim = anim;

#1
01/18/2008 (4:59 am)
I think I've figured it out, but I need a reliable way to get the name of the mounted image, and mount->getName() isn't all that reliable. When the player has no weapon, it crashes, and when they have a sword, it returns 'CrossbowImage' 65% of the time, and 'SwordImage' the rest. I'm going to look into it, but if anyone could save me some time...