# BABYLON.GridMaterial() is not a constructor

**URL:** <https://forum.babylonjs.com/t/babylon-gridmaterial-is-not-a-constructor/18543>\
**Category:** Questions\
**Tags:** material\
**Created:** [February 19, 2021, 3:12pm UTC](https://forum.babylonjs.com/t/babylon-gridmaterial-is-not-a-constructor/18543 "2021-02-19T15:12:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maya\_Rahto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/maya_rahto/32/7838_2.png) [@Maya\_Rahto](https://forum.babylonjs.com/u/Maya_Rahto)\
**Post date:** [February 19, 2021, 3:12pm UTC](https://forum.babylonjs.com/t/babylon-gridmaterial-is-not-a-constructor/18543/1 "2021-02-19T15:12:29Z")

</div>

I’m unable to run this command, because there isnt any GidMaterial() on my app, i got nothing working trying to add this gridmaterial to ground.

Could someone help me? I’m trying to use svelte + babylonjs

import \* as BABYLON from ‘babylonjs’;

export const createScene = (canvas) =\> {  
const engine = new BABYLON.Engine(canvas, true);  
const scene = new BABYLON.Scene(engine);  
scene.clearColor = new BABYLON.Color4(0.8, 0.8, 0.8, 1);

const camera = new BABYLON.ArcRotateCamera(“Camera”, Math.PI / 2, Math.PI / 2, 2, new BABYLON.Vector3(0, 20, -20), scene);  
camera.setTarget(new BABYLON.Vector3(0,20,0));  
camera.attachControl(canvas, true);

const light = new BABYLON.HemisphericLight(“light”, new BABYLON.Vector3(0, 10, 0), scene);  
light.intensity = 0.7;

const material = new BABYLON.StandardMaterial(“material”, scene);  
material.emissiveColor = new BABYLON.Color3(0.3, 0.3, 0.3);

// var gridMaterial = new BABYLON.GridMaterial(“default”, scene);  
var ground = BABYLON.Mesh.CreateGround(“ground”, 10000, 10000, 1, scene, false);  
// ground.material = gridMaterial;

engine.runRenderLoop(() =\> {  
scene.render();  
});

window.addEventListener(‘resize’, () =\> {  
engine.resize();  
});

return scene;  
}

If i uncomment those 2 lines, the app stop working.

---

<div class="post-metadata">

**Author:** ![kvasss](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kvasss/32/3774_2.png) [@kvasss](https://forum.babylonjs.com/u/kvasss)\
**Post date:** [February 19, 2021, 3:46pm UTC](https://forum.babylonjs.com/t/babylon-gridmaterial-is-not-a-constructor/18543/2 "2021-02-19T15:46:39Z")

</div>

Hi. grid material is separate module [Grid Material | Babylon.js Documentation](https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/gridMat#using-the-grid-material)  
Or you can use node material grid [https://playground.babylonjs.com/#VTSHNV#1](https://playground.babylonjs.com/#VTSHNV#1)

---

<div class="post-metadata">

**Author:** ![Maya\_Rahto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/maya_rahto/32/7838_2.png) [@Maya\_Rahto](https://forum.babylonjs.com/u/Maya_Rahto)\
**Post date:** [February 19, 2021, 3:58pm UTC](https://forum.babylonjs.com/t/babylon-gridmaterial-is-not-a-constructor/18543/3 "2021-02-19T15:58:41Z")

</div>

Thanks!!!
