Stop the same material from stretching differently on different objects
I have different sized objects that have the same material attached to them (wood, metal, etc). So if i have the tiling of the material look great on a cube but then scale the cube out the material stretches and I want to know if there is an easy way for the texture tile to remain the same size throughout all the game objects (no matter what their size)? Or if there is a way for the material tiling to auto-update as I scale an object bigger or smaller?
Answer by etaxi341 · Aug 30, 2016 at 11:52 AM
This is not a nice method but you could add a script that changes the tiling of the instance of material that is set to the gameobject based on the gameobjects format (width to height). I don't know if there is something that does i automatically for you but thats what i'd do.
Answer by CMWhewell · Aug 31, 2016 at 12:32 AM
This might be what you're looking for.
http://docs.unity3d.com/ScriptReference/Material-mainTextureScale.html
This is an official page from Unity that talks about scaling textures through code in both C# and Javascript.