Game Development Community

How do i create a sword attack

by Mark Hanham · in Torque X Platformer Kit · 08/19/2007 (5:17 pm) · 2 replies

Hi i want to create a sword attack and a simple gun attack
how do i define a button,can i do this just with components
can anyone help .

#1
08/20/2007 (10:44 am)
I can say you'll need to alter a few components. Possibly 3. The playercomponent which handles inputs, the animation manager, and possibly a brand new component or two for the weapons themselves. Its a fairly simple concept, and can be done easily.
#2
09/04/2007 (4:04 pm)
The animation manager has an "Action" animation. When you want your actor to perform an action, such as a specific attack, you can just swap out the ActionAnimationData to whatever animation you want to play for that action and then explicitly set the state to "Action". It will play the action animation and then revert to whatever it was doing before the action took place. For an example of how to explicitly set a state on the actor animation FSM, see the jump code in the on ground physics state update method.