Game Development Community

Playing through a whole animation?

by Rich Hudson · in Torque X 2D · 09/26/2007 (9:15 pm) · 1 replies

Anyway to force an animation to finish before starting a new one?

Because movement components are updated constantly (and thus the animations I have mapped to them do as well - stopped, walking, running), when I attempt to fire off an animation in the middle of this based on the player being hit (hit animation) it is barely a flickes as it is overridden by then next movement tick.

RH

#1
09/26/2007 (9:43 pm)
I figured it out - kinda easy in the end.

For those curious all I did was I wrapped the IsAnimationPlaying property of a given animation and exposed it in my Animation compnent, then so long as the characters STATE = HIT and the animation is playing then don't allow player to move (make sense anyway):

if(!(anim.IsAnimationPlaying() && anim.State == AnimationComponent.HIT))
MoveAidan(move);

RH