Model

self:set_animation_layer_filter

Shared

Restricts an animation layer to a set of bones

Syntax

local status = self:set_animation_layer_filter(
    layer,
    enabled,
    bone_paths,
    sync = true
)

Parameters

TypeNameDescription
intlayerIndex of the animation layer to modify
boolenabledWhether the bone filter is active
tablebone_pathsOptional list of bone paths the layer is limited to
boolsyncWhether the call is replicated to other peers

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Limit a layer to the arms
core.model.load("character", "models/character.glb")

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

entity:set_animation_layer_filter(1, true, {"Skeleton3D:arm_l", "Skeleton3D:arm_r"})
entity:play_animation_layer(1, "wave")
Remove the bone filter from a layer
core.model.load("character", "models/character.glb")

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

entity:set_animation_layer_filter(1, false)

On this page