You could avoid stopping the animation like this.
Where you tell your anim to walk add this-
anim_mode$="walk"
and add an anim_mode$ name for every animation.
then
function bewegen ()
if GetObjectX(frieder)<4
MoveObjectLocalZ (frieder, -0.1)
elseif GetObjectX(frieder)>4
If anim_mode$="walk"
PlayObjectAnimation( frieder, handlung[13], 0, 40, 0, 1 )
anim_mode$="standing" // if that is the anim you are going for next.
endif
endif
endfunction
I used this code as a test.
anim=0
if getrawmouseleftpressed()
cycle=cycle+1
if cycle>13 then cycle=1
anim=cycle
endif
if getrawmouserightpressed()
cycle=cycle-1
if cycle<1 then cycle=13
anim=cycle
endif
if anim>0
if anim=1
PlayObjectAnimation(trex,anim_name$,0,45,1,t_time#)
anim_mode$="WALK"
endif
if anim=2
PlayObjectAnimation(trex,anim_name$,47,77,1,t_time#)
anim_mode$="RUN"
endif
if anim=3
PlayObjectAnimation(trex,anim_name$,79,124,1,t_time#)
anim_mode$="STAND"
endif
if anim=4
PlayObjectAnimation(trex,anim_name$,126,276,1,t_time#)
anim_mode$="IDLE"
endif
if anim=5
PlayObjectAnimation(trex,anim_name$,278,398,1,t_time#)
anim_mode$="ROAR"
endif
if anim=6
PlayObjectAnimation(trex,anim_name$,400,430,1,t_time#)
anim_mode$="ATTACK 1"
endif
if anim=7
PlayObjectAnimation(trex,anim_name$,432,462,1,t_time#)
anim_mode$="ATTACK 2"
endif
if anim=8
PlayObjectAnimation(trex,anim_name$,464,494,1,t_time#)
anim_mode$="ATTACK 3"
endif
if anim=9
PlayObjectAnimation(trex,anim_name$,496,556,1,t_time#)
anim_mode$="WHIP TAIL"
endif
if anim=10
PlayObjectAnimation(trex,anim_name$,558,588,1,t_time#)
anim_mode$="HIT 1"
endif
if anim=11
PlayObjectAnimation(trex,anim_name$,590,620,1,t_time#)
anim_mode$="HIT 2"
endif
if anim=12
PlayObjectAnimation(trex,anim_name$,622,676,1,t_time#)
anim_mode$="DEATH"
endif
if anim=13
PlayObjectAnimation(trex,anim_name$,0,676,1,t_time#)
anim_mode$="ALL"
endif
endif
BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.