# Unable to load texture with obj file

**URL:** <https://discourse.threejs.org/t/unable-to-load-texture-with-obj-file/9385>\
**Category:** Questions\
**Tags:** obj-loader, mtl-loader, textures\
**Created:** [September 2, 2019, 12:23pm UTC](https://discourse.threejs.org/t/unable-to-load-texture-with-obj-file/9385 "2019-09-02T12:23:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harshvardhan](https://avatars.discourse-cdn.com/v4/letter/h/82dd89/32.png) [@harshvardhan](https://discourse.threejs.org/u/harshvardhan)\
**Post date:** [September 2, 2019, 12:23pm UTC](https://discourse.threejs.org/t/unable-to-load-texture-with-obj-file/9385/1 "2019-09-02T12:23:22Z")

</div>

Hello Everyone  
I am trying to upload texture with obj file but it showing this error

THREE.Object3D.add: object not an instance of THREE.Object3D.

here is my code

```auto
	  var mtlLoader = new THREE.MTLLoader();
mtlLoader.setPath('new/obj/');
mtlLoader.load('coat_.mtl', function(materials) {
  materials.preload();
  var objLoader = new THREE.OBJLoader2();
  objLoader.setMaterials(materials);
  objLoader.setPath('new/obj/');
  objLoader.load('coat_.obj', function(object) {
    //object.position.y = -95;
    scene.add(object);
  });
});

```

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [September 2, 2019, 1:55pm UTC](https://discourse.threejs.org/t/unable-to-load-texture-with-obj-file/9385/2 "2019-09-02T13:55:26Z")

</div>

Can you please use `THREE.OBJLoader` and not `THREE.OBJLoader2`? Otherwise you have to write your code like in this example:

[https://threejs.org/examples/#webgl\_loader\_obj2](https://threejs.org/examples/#webgl_loader_obj2)

Notice that both loaders have a slightly different API.
