How can i animate mesh ? And how to add animation actions if i has mesh.animations.length = 0

If the animations array if empty, it means no animation are defined for the given 3D object.

The animation system of three.js is mostly intended to playback pre-defined animations in 3D assets. Its API is low level and optimized for performance which makes it a bit hard for manually defining animations on app level.

If you just want to animate a mesh so it moves from point A to B you probably want to use a library like GSAP or Tween.js. I suggest you search the forum for related topics and you will find some code and live examples.

1 Like