Game Development Community

Moving the player forward when attacking

by Caleb · in Torque Game Engine · 03/24/2007 (4:59 pm) · 1 replies

Maybe you could do this in script, but I posted here just in case. Ok, I'd like when ever the player attacks, he stops and does a fancy attack animation wile he takes a step forward. How do I do this?

Any help is great.

#1
03/25/2007 (12:07 pm)
Ok, here's what I have so far.

I commented out this bit of code:
// Cancel any script driven animations if we are going to move.
      //if (moveVec.x + moveVec.y + moveVec.z != 0 &&
          //(mActionAnimation.action >= PlayerData::NumTableActionAnims
               //|| mActionAnimation.action == PlayerData::LandAnim))
         //mActionAnimation.action = PlayerData::NullAnimation;
This allows me to use "setActionThread" without movement interrupting the animation.
Locking the players forward movement for a few seconds, can be done from script, so that just leaves changing the player's speed.

I got setMoveSpeed from the AI code, but whenever I change the speed, the player's movement is jumpy.
How do I fix this?
Thanks.