Hi Guys, I’m new to babylon and typescript so please bare with me.
I’m trying to create a ground with grid material from following one of the examples that was NOT in typescript.
In this block of code the material properties for gridRatio, mainColor, lineColor, and opacity ALL say that the property does NOT exist on material property.
private _ground: BABYLON.Mesh;
this._ground = BABYLON.MeshBuilder.CreateGround("grid", { width: 20, height: 20 }, this._scene);
this._ground.material = new BABYLON.GridMaterial("grid", this._scene);
this._ground.material.backFaceCulling = false;
this._ground.material.gridRatio = 1;
this._ground.material.mainColor = new BABYLON.Color3(0.6, 0.6, 0.6);
this._ground.material.lineColor = new BABYLON.Color3(0.7, 0.7, 0.7);
this._ground.material.opacity = 0.3;
this._ground.material.freeze();
this._ground.position.y = -0.5;
this._ground.isPickable = false;
this._ground.doNotSyncBoundingInfo = true;
this._ground.convertToUnIndexedMesh();
this._ground.freezeWorldMatrix();
this._ground.freezeNormals();
I’m thinking _ground needs to be defined as something else, or the gridmaterial is not correct.
Not sure.
Thanks in advance.