This command makes an entity automatically play an animation sequence.
- PlayAnimation(string sequence,number speed=1.0f, number blendtime=500, number mode=0)
- PlayAnimation(number sequence,number speed = 1.0f,number blendtime = 500, number mode = 0)
- sequence: the sequence name or index of the animation to be played.
- speed: the speed at which to play the animation.
- blendtime: the number of milliseconds it takes for the current animation to smoothly replace the previously played animation.
- mode: set to zero for looping animation or one for one-shot animation. When one-shot animation mode is used, the script or actor function EndAnimation() will be called when the sequence is completed, passing the sequence number in as an argument.
window = Window:Create()
context = Context:Create(window)
world = World:Create()
camera = Camera:Create()
light = DirectionalLight:Create()
--Load a model
model = Model:Load("Models/Characters/Crawler/crawler.mdl")
--Play an animation
while true do
if window:Closed() or window:KeyHit(Key.Escape) then break end