# How to add glb loader in lightmap example

**URL:** <https://discourse.threejs.org/t/how-to-add-glb-loader-in-lightmap-example/15477>\
**Category:** Questions\
**Tags:** gltf-loader, getting-started\
**Created:** [May 23, 2020, 1:39pm UTC](https://discourse.threejs.org/t/how-to-add-glb-loader-in-lightmap-example/15477 "2020-05-23T13:39:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sagir](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sagir/32/11085_2.png) [@sagir](https://discourse.threejs.org/u/sagir)\
**Post date:** [May 23, 2020, 1:39pm UTC](https://discourse.threejs.org/t/how-to-add-glb-loader-in-lightmap-example/15477/1 "2020-05-23T13:39:01Z")

</div>

İ want to use this example.

[https://threejs.org/examples/?q=light#webgl\_materials\_lightmap](https://threejs.org/examples/?q=light#webgl_materials_lightmap)

İ add loader code

var loader = new GLTFLoader().setPath( ‘models/gltf/DamagedHelmet/glTF/’ );  
loader.load( ‘DamagedHelmet.gltf’, function ( gltf ) {

```
						scene.add( gltf.scene );

```

});

İt done

Uncaught TypeError: THREE.GLTFLoader is not a constructor

---

<div class="post-metadata">

**Author:** ![mjurczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mjurczyk/32/10995_2.png) [@mjurczyk](https://discourse.threejs.org/u/mjurczyk)\
**Post date:** [May 23, 2020, 1:42pm UTC](https://discourse.threejs.org/t/how-to-add-glb-loader-in-lightmap-example/15477/2 "2020-05-23T13:42:12Z")

</div>

You must first import `GLTFLoader` from a separate file (it’s not a part of core ThreeJS.)  
See this example:

> <https://github.com/mrdoob/three.js/blob/79edf22a345079dc6cf5d8c6ad38ee22e9edab3c/examples/webgl_loader_gltf.html#L23>

Edit: The error suggests your code looks a bit different, too. It should be `new GLTFLoader()`, without the `THREE.` part.

---

<div class="post-metadata">

**Author:** ![sagir](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sagir/32/11085_2.png) [@sagir](https://discourse.threejs.org/u/sagir)\
**Post date:** [May 23, 2020, 2:16pm UTC](https://discourse.threejs.org/t/how-to-add-glb-loader-in-lightmap-example/15477/3 "2020-05-23T14:16:20Z")

</div>

İ try your solution but ,.  
My problem continue ☹

---

<div class="post-metadata">

**Author:** ![sagir](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sagir/32/11085_2.png) [@sagir](https://discourse.threejs.org/u/sagir)\
**Post date:** [May 23, 2020, 5:00pm UTC](https://discourse.threejs.org/t/how-to-add-glb-loader-in-lightmap-example/15477/4 "2020-05-23T17:00:54Z")

</div>

Ah okey now solved problem. Thanks
