Vital.sandbox
Model

self:play_animation

Shared

Plays a specified animation on the model


Syntax

local status = self:play_animation(name, loop = true, speed = 1.0)

Parameters

TypeNameDescription
stringnameName of the animation to play
boolloopDetermines whether the animation loops:
• When true - the animation loops continuously
• When false - the animation plays once
floatspeedPlayback speed multiplier

Returns

TypeNameDescription
boolstatustrue on successful execution, or false on failure

Examples

Play various animations value on a model
local entity = model.create("character")

--Play looping idle animation at default speed
entity:play_animation("idle")

--Play walk animation once at half speed
entity:play_animation("walk", false, 0.5)

On this page