exiting animation loop

Blitz3D Forums/Blitz3D Programming/exiting animation loop

I'm not sure what you did using SetAnimTime or why you are checking animation frames, but this is how I do it (assuming "idle" is sequence 2 and "walk" is 1):


If KeyDown(30)

If AnimSeq(p\model)<>1
Animate p\model,1,.5,1,.5
EndIf
MoveEntity p\model,0,0,.3

Else

If AnimSeq(p\model)<>2
Animate p\model,1,.5,2,.5
EndIf

EndIf


Basically I have nested If statements to check first if the key for walking is being held down. If so it then checks if the character is already in the walk animation; if not then start playing the walk animation. A similar check happens for the idle animation if the key is not being held down.

Oh, and MoveEntity happens inside of the check for the key pressed down but outside the check if the walk animation is already playing.