What's wrong with this script? I suspect the problem is the line in bold but for the life of me I can't see what's wrong. The animations don't play and the titletext comes up with "_anim" every time, rather than the name of the animation concerned. The loons do animate when I put an animation in by hand.
Many thanks
; this script plays animations
_animArray = ["EffectStandSalute", "Crouch", "CrouchB", "CrouchDying", "CrouchToCombat"]
_unitList = [loon1, loon2]
_i=0
#loop
_anim=_animArray select _i
titletext [format ["%1", {_anim}],"plain down",1]
"_x switchMove {_anim}" forEach _unitList
"_x playMove {_anim}" forEach _unitList
~4
"_x playMove {null}" forEach _unitList
"_x switchMove {null}" forEach _unitList
_i=_i+1
? _i >= (count _animArray) + 1: goto "end"
goto "loop"
#end
hint "That's all folks"
~3
exit