Model

self:set_animation_layer_weight

Shared

Sets the blend weight of an animation layer

Syntax

local status = self:set_animation_layer_weight(
    layer,
    weight,
    blend_time = 0,
    sync = true
)

Parameters

TypeNameDescription
intlayerIndex of the animation layer to modify
floatweightNew blend weight of the layer
floatblend_timeTime in seconds to blend to the new weight
boolsyncWhether the call is replicated to other peers

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Fade a layer out over half a second
core.model.load("character", "models/character.glb")

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

entity:play_animation_layer(1, "wave")
entity:set_animation_layer_weight(1, 0, 0.5)

On this page