Hello, i have a little problem. I adding texture after spawn cube for example but this cube spawn in not the same localScale.z . I need to have tiling of texture the same on all objects, how can i do this ? Here is picture how i have it. But i want the same texture on both of them .
Thank you a lot.
37773-tiling.png

transform.renderer.material.SetTextureScale(“_MainTex”, new Vector3(1f / transform.scale.z, 1));

also try multiplying the z value with some coefficients if this does not work.

EDIT: fixed the code line

Whats mean MainTex?