Hi,All
I have a gltf model that contains multiple animations,The default animation is not what I want, how do I switch between the specified animation in the code ??
this is model:
http://devmodels.oss-cn-shenzhen.aliyuncs.com/devtest/liubofang/glb/electricWorker.gltf

this.is code
Hi there,
Here’s an example from the docs.
// Load a model and play the last animation at half speed
let animations;
try {
const model = await Cesium.Model.fromGltfAsync({
url: "../../SampleData/models/CesiumMan/Cesium_Man.glb",
gltfCallback: gltf => {
animations = gltf.animations
}
});
viewer.scene.primitives.add(model);
model.readyEvent.addEventListener(() => {
model.activeAnimations.add({
index: animations.length - 1,
loop: Cesium.ModelAnimationLoop.REPEAT,
multiplier: 0.5,
});
});
} catch (error) {
console.log(`Failed to load model. ${error}`);
}