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
| Type | Name | Description |
|---|---|---|
string | name | Name of the animation to play |
bool | loop | Determines whether the animation loops: • When true - the animation loops continuously• When false - the animation plays once |
float | speed | Playback speed multiplier |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, or false on failure |
Examples
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)