iam trying to bring a character with a skeleton animation into my scene. the character has two simple animation in one action, one from frame 1-24, the other from frame 25-61. After checking the examples scene.beginAnimation() is what iam looking for but no animation starts.
i tested my code with the .babylon file from this example:
https://www.babylonjs-playground.com/#BCU1XR#0
and it works… but i cant figure out why? is there an issue regarding frameranges an gltf file?
thats my code:
class SkeletonObject extends BABYLON.Mesh{
constructor(name, scene){
super()
this.name = name
this.scene = scene
this.checkCollisions = true
this.ellipsoid = new BABYLON.Vector3(0.5,0.5,0.5)
this.mesh
this.importobject
this.skeleton
BABYLON.SceneLoader.ImportMesh("", "assets/", "Dummy.glb", this.scene, (meshes, particlesystems, skeletons)=>{
this.skeleton = skeletons[0]
this.importobject = this.scene.getNodeByName("__root__")
this.importobject.name = this.name + "_root"
this.mesh = meshes[1]
this.init()
})
}
init(){
this.importobject.parent = this
// this.scene.beginAnimation(this.skeleton, 25, 59, true, 1.0) //idle animaton
this.scene.beginAnimation(this.skeleton, 1, 24, true, 1.0) //walk animaton
}
update(dt){
this.rotation.y+= (Math.PI/ 5.3) *dt
}
}
and here is my gltf file
Dummy.zip (333.5 KB)