Hi I’m new to babylon.js and I’m trying the official tutorial.
I’m testing this(https://playground.babylonjs.com/#20OAV9#25) in my local environment, but as I mentioned in the title, I got errors like “Property ‘uScale’ does not exist on type ‘BaseTexture’. Did you mean ‘scale’?” for these parts:
Hey. This is not telling much. In theory this should work. We will probably need more info to figure it out. Can you share your code somehow? How are you defining textures and materials in your local environment. Maybe even version of Babylon.
If you look at the properties of BaseTexture though. There is indeed no uScale and vScale, but why you end up with BaseTexture is the question
material.diffuseTexture is of type BaseTexture, and I can only assume you have made the right decision and are using typescript Which is the main issue here (or better - it is the difference between the playground and your code).
The properties are there, since you have defined the diffuseTexture yourself), but typescript doesn’t recognize them.
What you can do is change the uScale of the texture you have created and not of the assigned diffuseTexture. something like this:
typescript is type safe. it means that if you don’t case and we define that a certain variable is of a certain type, this is the type the property will be checked against.
Gosh, what a sentence… sorry.
material.diffuseTexture is a BaseTexture.
The Texture you have created is of type Texture, which extends BaseTexture.
Texture has uScale, BaseTexture does not.
Type-safety-wise, material.diffuseTexture does not have uScale. But if you set it to be of type Texture, the original class can have uScale set, since it is of the right type.