# Animations aren't playing well, am I even doing this right?

**URL:** <https://discourse.threejs.org/t/animations-arent-playing-well-am-i-even-doing-this-right/6817>\
**Category:** Questions\
**Tags:** gltf-loader, animation\
**Created:** [March 29, 2019, 5:48pm UTC](https://discourse.threejs.org/t/animations-arent-playing-well-am-i-even-doing-this-right/6817 "2019-03-29T17:48:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alekangelov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/alekangelov/32/4822_2.png) [@alekangelov](https://discourse.threejs.org/u/alekangelov)\
**Post date:** [March 29, 2019, 5:48pm UTC](https://discourse.threejs.org/t/animations-arent-playing-well-am-i-even-doing-this-right/6817/1 "2019-03-29T17:48:01Z")

</div>

I’ve read the documentation i’ve done everything but this is just not working.

So I have this fbx/gltf whatever file and the animations are wonderful inside of 3dsmax, maya, c4d whatever, but when I import them into threejs and loop through and play the animations they’re just not behaving properly.

Here’s my fbx with the animation: [https://drive.google.com/file/d/1YzsRZpl5jM8Ax6IldvWr6tjJYyt\_o2wC/view?usp=sharing](https://drive.google.com/file/d/1YzsRZpl5jM8Ax6IldvWr6tjJYyt_o2wC/view?usp=sharing)

and my gltf file: [https://drive.google.com/file/d/1DHyfQXR0zN0iyopumXFC0ckrBaDxeDYi/view?usp=sharing](https://drive.google.com/file/d/1DHyfQXR0zN0iyopumXFC0ckrBaDxeDYi/view?usp=sharing)

I am absolutely lost any and all help would be absolutely heavenly.

Thanks in advance \<3

ps here’s how I’m doing it with code:

```
const loader = new GLTFLoader();
loader.load(logo, obj => {
  // GLBLoader
  console.log(obj);
  obj.scene.scale.set(0.001, 0.001, 0.001);
  obj.scene.position.set(0, 0, 0);
  this.scene.add(obj.scene);
  this.object = obj.scene;
  this.mixer = new THREE.AnimationMixer(this.object);
  obj.animations.forEach((animation, i) => {
    this.mixer.clipAction(animation).play()
  });
});
```

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [March 29, 2019, 6:05pm UTC](https://discourse.threejs.org/t/animations-arent-playing-well-am-i-even-doing-this-right/6817/2 "2019-03-29T18:05:15Z")

</div>

What was the glTF version created with? I’m not sure it’s written correctly, and you definitely shouldn’t need to play a separate animation clip for each fragment in the model… taking the FBX version and converting it with Facebook’s FBX2GLTF, I think I’m getting the right result:  
 ![A0694F20-422E-47E8-A2DB-B40D5912A558-11429-0000027A32A512E1](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/2X/3/3aabd2444363da4067b3950247e5483683f4abf9.gif)

(testing in [http://gltf-viewer.donmccurdy.com/](http://gltf-viewer.donmccurdy.com/))

---

<div class="post-metadata">

**Author:** ![alekangelov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/alekangelov/32/4822_2.png) [@alekangelov](https://discourse.threejs.org/u/alekangelov)\
**Post date:** [March 29, 2019, 6:29pm UTC](https://discourse.threejs.org/t/animations-arent-playing-well-am-i-even-doing-this-right/6817/3 "2019-03-29T18:29:30Z")

</div>

Exported it with the Cinema4D GLTF exporter. Is there a better way of doing it? I’ve done some three js in the past but it’s my first time working with this kind of stuff. Should I be considering adding a physics engine and doing this all in code?

---

<div class="post-metadata">

**Author:** ![alekangelov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/alekangelov/32/4822_2.png) [@alekangelov](https://discourse.threejs.org/u/alekangelov)\
**Post date:** [March 29, 2019, 6:48pm UTC](https://discourse.threejs.org/t/animations-arent-playing-well-am-i-even-doing-this-right/6817/4 "2019-03-29T18:48:59Z")

</div>

Also can you please provide me with that file because every time I’m trying to do this I’m literally getting just absolute botched models it’s so frustrating 😖I’m so sorry for the trouble

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [March 29, 2019, 7:12pm UTC](https://discourse.threejs.org/t/animations-arent-playing-well-am-i-even-doing-this-right/6817/5 "2019-03-29T19:12:41Z")

</div>

Oh ok – the C4D exporter is very new and still in “Maxon Labs” (which I guess is experimental stuff?). I didn’t know they had animation support yet actually. Anyway this conversion with FBX2GLTF works:

[explosion.glb](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/1/1d6462c9d723bee3dbd108ebd48201acdb0ff534.glb) (1.4 MB)

Maybe worth filing a couple bugs on the C4D exporter if there’s a way:

- file should include an `asset.generator` string so devs can identify how it was created
- animations should be bundled into a single glTF animation entry if they’re meant to be played together, not separate small animations for each piece of the model
- something is buggy in the TRS animation export, maybe quaternion rotations need to be resampled.
