Animation using FBXLoader

Hello, I tried downloading an fbx file with animations. When I use FBXLoader(), I get a typescript error that Property animations does not exist on type Group for “obj.animations”. I’m not sure why that is since I am following examples found online

    let mixer;
    let fbx = new FBXLoader();
    fbx.load("../images/Dragon.fbx", function(obj) {

      mixer = new T.AnimationMixer( obj );
	  let action = mixer.clipAction( obj.animations[0] );;
      //more code here   

I don’t use typescript so I’m not sure what that error means. But not all FBX files contain animations. Have you checked whether obj.animations[0] exists?

See code examples on this page,

Cast your obj as any before you use it.

According to my example, i’ve adjusted your code as. (I cant test your code to be sure)

let action = mixer.clipAction( (obj as any).animations[0] );

When the fbxloader has finished downloading and passes the object to the onLoad callback, the data is a type of THREE.Group.
THREE.Group doesn’t have an animations property for typescript to type check against. So you need to cast your object, obj in your case, as any to stop the editor from thinking it is a problem.