Mixer.update doest not start/update animation

I’m using following example https://threejs.org/examples/#webgl_animation_multiple and try to get it running locally.
Models are loaded, AnimationClips are found and everthing is set up. But my animation doesn’t start nor does anything, model is just standing around and doing nothing…
There are no error logs.
What do I miss or didn’t look at?

function animate() {
	requestAnimationFrame( animate );
	// Get the time elapsed since the last frame
	var mixerUpdateDelta = clock.getDelta();
	// Update all the animation frames
	for ( var i = 0; i < mixers.length; ++ i ) {
		mixers[ i ].update( mixerUpdateDelta );
	}		
	renderer.render( worldScene, camera );
}

function instantiateUnits() {
	for ( var i = 0; i < UNITS.length; ++ i ) {
		var u = UNITS[ i ];
		var model = getModelByName( u.modelName );
		var clonedScene = THREE.SkeletonUtils.clone( model.scene );
		worldScene.add( clonedScene );
		const mixer = new THREE.AnimationMixer( model.scene );
		mixers.push( mixer );
		var clip = THREE.AnimationClip.findByName( model.animations, "Running" );
		const action = mixer.clipAction( clip );
		action.play();
	}	
}

Please verify if skinning property of all instanced of SkinnedMesh is set to true. If you load a model with a loader, this is automatically done. However, if you setup your stuff by yourself, you might miss this configuration.

If this does not solve your issue, consider to demonstrate it with a live example for debugging purposes.

As I see the loaded model mesh .isSkinnedMesh was undefined, so I’ve set it to true but that did not help.
I’m trying to make a fiddle but I don’t know how to upload my needed model?

You can also share a github respository with your code and assets.

here you go: https://github.com/wololoaoe/git
your help is really appreciated

Here is your code with my changes. The animations seem to work now: app.zip (248.0 KB)

The problem was that you have to playback the animations with the correct root object which is not the skinned mesh itself but the entire glTF scene. When doing so, the animation system is able to target the correct 3D objects in your scene.

Thank you very much!

Would you say having like 100-1000 models in a scene and moving them on x axis with the current setup is sufficent/feasible? Or are there any other measures I should consider?

If your animated objects share the same animation state, consider to use THREE.AnimationObjectGroup to improve the performance. There is also a simple example that demonstrates this class:

https://threejs.org/examples/misc_animation_groups

2 Likes