Model
self:play_animation_layer
SharedPlays an animation on the given layer of the model
Syntax
local status = self:play_animation_layer(
layer,
name,
loop = true,
speed = 1,
weight = 1,
blend_time = 0.25,
sync = true
)Parameters
| Type | Name | Description |
|---|---|---|
int | layer | Index of the animation layer to play on |
string | name | Name of the animation to play |
bool | loop | Whether the animation loops |
float | speed | Playback speed multiplier |
float | weight | Blend weight of the layer |
float | blend_time | Time in seconds to blend into the animation |
bool | sync | Whether the call is replicated to other peers |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
core.model.load("character", "models/character.glb")
local entity = core.model.create("character")
entity:play_animation_layer(0, "idle")core.model.load("character", "models/character.glb")
local entity = core.model.create("character")
entity:play_animation_layer(0, "walk")
entity:set_animation_layer_filter(1, true, {"Skeleton3D:spine", "Skeleton3D:arm_l", "Skeleton3D:arm_r"})
entity:play_animation_layer(1, "wave", false, 1, 1, 0.1)