LOOP OBJECT This command will play and loop the animation data contained within the specified 3D object from the beginning.
Syntax
    LOOP OBJECT Object Number
    LOOP OBJECT Object Number, Start Frame
    LOOP OBJECT Object Number, Start Frame, End Frame
Parameters
    Object Number
Integer The object number
    Start Frame
Integer The start frame number
    End Frame
Integer The end frame number
Returns
This command does not return a value.
Description
You can optionally play and loop the animation by providing a specified start and end frame. The parameters should be specified using integer values.
Example Code
    sync on : sync rate 0 : hide mouse:cls 0

    ObjectNumber=1

    load object "models\model.x",ObjectNumber

    append object "models\extraanim.x", ObjectNumber, total object frames(ObjectNumber)+1

    set object speed ObjectNumber,5

    loop object ObjectNumber,0,total object frames(ObjectNumber)

    while mouseclick()=0

    sync

    endwhile

    while mouseclick()=1:endwhile

    stop object ObjectNumber

    if object exist(ObjectNumber)=1 then delete object ObjectNumber

    end
See also
BASIC3D Commands Menu Index