Closed ChromeGG closed 1 year ago
It's expected, Mesh.material
is of type Material
, which does not have a diffuseColor
property.
You should do groundMaterial.diffuseColor = BABYLON.Color3.Red();
instead.
@Popov72 Yeah, but then the docs and example should be updated, isn't?
I think the docs and examples are in js? Do you have an example of a doc/example that does not work?
This is the example: https://playground.babylonjs.com/#2KRNG9%231 written in JS. Hmm... I thought we should be able to switch from JS to TS w/o errors errors like some field doesn't exist. If TS is raising an errors but JS implementation is fine, then it could be an indicator of not adjusted types.
Use Github issues ONLY for bugs validated on the forum first!
We have a really active forum to help answering questions (https://forum.babylonjs.com/)
Repro
ERROR: Property 'diffuseColor' does not exist on type 'Material'.
Screenshots![CleanShot 2023-06-25 at 09 16 14](https://github.com/BabylonJS/Babylon.js/assets/39050595/3843d700-4759-4a11-86c6-aa5ffba02e95)
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context It works for JS. So I guess it's just some typing error