Model

self:stop_animation_layer

Shared

Stops the animation playing on the given layer

Syntax

local status = self:stop_animation_layer(
    layer,
    blend_time = 0.25,
    sync = true
)

Parameters

TypeNameDescription
intlayerIndex of the animation layer to stop
floatblend_timeTime in seconds to blend out of the animation
boolsyncWhether the call is replicated to other peers

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

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

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

entity:play_animation_layer(0, "idle")
entity:stop_animation_layer(0)

On this page