anim on MD2 ??

Blitz3D Forums/Blitz3D Beginners Area/anim on MD2 ??

CodeOrc(Posted 2008) [#1]
I am trying To Animate my model to an attack anim sequence when my moster is close To player, and walk when it is far enough away from player.


	If EntityDistance(player,a\entity)<5 AnimateMD2 a\entity,1,.75,197,210 ; attack
		
	If EntityDistance(player,a\entity)>5 AnimateMD2 a\entity,1,.75,332,380 ; walk


the code above works, but the problem is that it plays the first frame over-And-over depending on the case....how can I make it simply loop through the frames the same way a B3D file does with it's Animate command?


Mortiis(Posted 2008) [#2]
Add another if statement telling only to animate if the animation frame is not between the attack frames. Like below;

If EntityDistance(player,a\entity) < 5
	If MD2AnimTime(player) < 197 Or MD2AnimTime(player) > 210
		AnimateMD2 a\entity,1,.75,197,210 ; attack
	EndIf
EndIf



CodeOrc(Posted 2008) [#3]
THX!! It worked great!