I want to have the parameters of my texture driven by outside variables. Is there a way of doing this?
Though it's not called Texture.tiling or Material.mainTextureTiling (as you'd think it should be), the correct method is here: http://unity3d.com/support/documentation/ScriptReference/Material-mainTextureScale.html
It's as easy as
renderer.material.mainTextureScale = new Vector2 (x, y);
Yes. In this case, what you are changing isn't the texture itself (although there are plenty of changes scripts can make to textures.) What you are changing is how the texture is applied, through a Material.
You can see this clearly in the editor- the texture scale and offset values are on the material component that is using the texture.
See the documentation page on Materials for how to do it. There are properties for the scale and offset of the main texture. For materials with more than one texture, there are methods for getting and setting scale and offset of other textures.
Thanks for the answer everyone, I’ve been looking for this ‘tiling’ variable like a mad too (haha). The Unity staff member should maintain a better naming convention between the editor and the built-in classes ![]()