Command animations
Blitz3D Forums/Blitz3D Programming/Command animations
| ||
I have an issue, I have two animations one run and another to walk, do not know how to change animations smoothly and not be seen to be jumping each other, another thing is that I find the shape of these animations change when I press a key, then use KeyDown (W%) and the animation is skipped over and over again. |
| ||
| to blend animations, just add a "smooth value" on the last parameters eg : Animate MyEntity,3, 1.0, Sequence, 10.0 (where @Sequence is the loaded/extracted animseq -> or "0" for the full internal animation of the mesh) to answer your second question, use a key to test if animation has been started
If KeyDown(MyKey)
If KeyAnim = 0
; loop the Run sequence and animate the entity
Animate MyEntity, 1, 1.0, RunAnim, 10.0
KeyAnim = 1
endif
Else
If KeyAnim = 1
KeyAnim = 0
; stop the animation if animating
; modify this part if you want to blend with a standbye
; animation or else
; -> simply replace Animate parameters to fit your needs
if Animating(MyEntity)
Animate MyEntity, 0
endif
EndIf
Endif
(coded on the fly, not tested, should probably work, but may contain mistakes) Last edited 2012 |