Question by
TheOnlyMrCat · May 01, 2019 at 08:07 AM ·
c#texturematerial
Lightweight RP change texture scale
I'm trying to use scaled planes to create a level. All of these use the same material, so I'm modifying each material to have the texture be unaffected by the plane's scale.
var render = GetComponent();
var scale = new Vector2(transform.localScale.x, transform.localScale.z);
render.material.SetTextureScale("_MainTex", scale);
render.material.SetTextureScale("_BumpMap", scale);
The property does get set, however, no change is seen in the game or in the material's settings. The code had worked fine before I switched to the lightweight render profile. The material now uses the Lightweight Render Profile/Lit
shader.
How do I fix this?
Comment