Found a bug in Your journey starts here - The very first step tutorial

Hello, just getting started with babylon.
I was doing this tutorial (The Very First Step | Babylon.js Documentation) when i came across this bug:

It should be “groundMaterial.diffuseColor” and “groundMaterial.diffuseTexture

It wasn’t a problem for me but i can image for a person who is new to programming this could be a challenge figuring this one out.

1 Like

Actually it is not a bug. What is written for color and texture is correct and will work as can be seen in plagrounds 2 amd 4. Although having set the variable groundMaterial it makes more sense to use it and set up groundMaterial first and then assign it to ground.material

let groundMaterial = new BABYLON.StandardMaterial("Ground Material");
groundMaterial.diffuseColor = BABYLON.Color3.Red();


ground.material = groundMaterial;

Alternative

let groundMaterial = new BABYLON.StandardMaterial("Ground Material");
let groundTexture = new BABYLON.Texture(Assets.textures.checkerboard_basecolor_png.rootUrl, scene);
groundMaterial.diffuseTexture = groundTexture;


ground.material = groundMaterial;

pinging @PirateJC

2 Likes