BabylonJS / Documentation

Babylon.js's documentation website
https://doc.babylonjs.com
Apache License 2.0
76 stars 234 forks source link

Incorrect code example in "The Very First Step" tutorial #912

Closed legacy5813 closed 1 year ago

legacy5813 commented 1 year ago

in the stage "Find the line of code that creates the ground plane and add these new lines underneath it"

the code example in line 4 states "ground.material.diffuseColor = BABYLON.Color3.Red();" but diffuseColor is not a property of ground.material.

The correct code is accessing the ground material through a new babylon standard material class i.e. [ let groundMaterial = new BABYLON.StandardMaterial("Ground Material", scene); groundMaterial.diffuseColor = BABYLON.Color3.Red(); ]

Tutorial link: https://doc.babylonjs.com/journey/theFirstStep -Go to playground 2 step

RaananW commented 1 year ago

You are totally right! whereas in js it will work without a problem, typescript will complain here. I have updated the code and the playgrounds.

legacy5813 commented 1 year ago

You are totally right! whereas in js it will work without a problem, typescript will complain here. I have updated the code and the playgrounds.

thank you!