Model

self:get_current_animation_layer

Shared

Retrieves the name of the animation playing on the given layer

Syntax

local name = self:get_current_animation_layer(
    layer
)

Parameters

TypeNameDescription
intlayerIndex of the animation layer to query

Returns

TypeNameDescription
stringnameName of the animation playing on the layer, empty when nothing is playing

Examples

Get the animation playing on a layer
core.model.load("character", "models/character.glb")

local entity = core.model.create("character")

entity:play_animation_layer(0, "idle")
core.engine.print("info", "Layer 0:", entity:get_current_animation_layer(0))

On this page