Platform Starter Kit Animations
by Torquer · in Torque X 2D · 10/23/2010 (3:27 am) · 2 replies
Hi there,
I'm trying to add an attack animation to the player, and seem to be running into some roadblocks. What I did was in the PlayerActorComponent, defined a new animation that can be set in the builder, as well as a new animation state for my attack.
In the PlayerController, I'm looking for a specific button to be pressed in ProcessTick, then calling a method on the PlayerActor to set the state. The animation plays fine, however, the state is never set back to idle.
If the player just hits the button, and no enemies are there to receive the attack, or anything of that nature, I'm finding it troublesome to end the animation and return to the idle state.
Has anyone else encountered this? I'd love to hear about your solution if you did. Thanks so much in advance.
I'm trying to add an attack animation to the player, and seem to be running into some roadblocks. What I did was in the PlayerActorComponent, defined a new animation that can be set in the builder, as well as a new animation state for my attack.
In the PlayerController, I'm looking for a specific button to be pressed in ProcessTick, then calling a method on the PlayerActor to set the state. The animation plays fine, however, the state is never set back to idle.
If the player just hits the button, and no enemies are there to receive the attack, or anything of that nature, I'm finding it troublesome to end the animation and return to the idle state.
Has anyone else encountered this? I'd love to hear about your solution if you did. Thanks so much in advance.
Torque 3D Owner Will O-Reagan
Modern Intrigues
Theres three state machines.
AI.
Physics.
Animation.
Learn them, if you want to navigate from state to state properly, you must use the state machines properly, or you'll end up in situations like you just described. Also, wrong forum, there is a PSK for torqueX forum.
Finally, I think several people have accomplished what you are describing already, and written about it, look around in past threads in the PSK torqueX forum, and I'm sure you'll find something more useful then what I could write right now.