0

I’m trying to execute the animation of a model found on internet. The expected animation is to have all the fans running. But when I tried to play the animation, it’s just the computer rotating on the X abscissa. I thought maybe its animations are somewhere else, so I logged the animation, and there is an array of tracks with all the fans in it. Being new in threejs I was wondering I'm not really sure how I should manage that, if it's an error from me or from the model itself. However, when I tried to run the model through gltf-viewer, the model works fine.

I didn't touch anything on the model in my code, I just created a canva, loaded the model and play its animation by using the following lines.

const group = useRef()
  const { nodes, materials, animations } = useGLTF('/scene.gltf')
  const { actions, names } = useAnimations(animations, group)
  useEffect(() => {
    actions[names].play()
})

Here is the link of the model if somebody would like to try on its own

3D model

samuel potter
  • 189
  • 3
  • 13
  • Have you tried with actions[names]?.play() Maybe some other animations are playing and you might need to stop them – codeanjero Aug 20 '21 at 19:08
  • this thread might help you https://stackoverflow.com/questions/63936267/how-to-extract-and-play-animation-in-react-three-fiber – Laphaze Aug 24 '21 at 08:52

0 Answers0