Model

self:is_animation_layer_playing

Shared

Checks whether an animation is playing on the given layer

Syntax

local result = self:is_animation_layer_playing(
    layer
)

Parameters

TypeNameDescription
intlayerIndex of the animation layer to check

Returns

TypeNameDescription
boolresulttrue if the layer is playing an animation, false otherwise

Examples

Check whether a layer is playing
core.model.load("character", "models/character.glb")

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

entity:play_animation_layer(0, "idle")
core.engine.print("info", entity:is_animation_layer_playing(0)) -- true

On this page