Material mainTextureScale doesn't work

Trying to set a standard URP material’s mainTextureScale value via code doesn’t work.

Example code:

Material mat = new Material(materialToCopy);
        mat.mainTextureScale = new Vector2(.5f, .5f);
        renderer.material = mat;

It works in the scene view at runtime but not the game view or on the simulator.

Yes, this is an issue we’re aware of. It will be fixed in the next release. I don’t know of any workaround at the moment other than to use a shader graph material, pass the texture scale in as a property, and apply that scale to the UV within the shader graph before sampling the texture.