Modifing Material Tiling by script
I tried to handle the streching of a texture by modifing the tile - parameter in the Material via editor (see pic) .
This works for me but now I tried to modify this by a script. But I cant find a Member like Tiling in the Material class... Maybe I am on the Wrong way :) can some one give me a hint, please? The main problem I try to solve is to keep the texture in the correct scale depending on the size of the body. The Body is alway a multiple from the textures size. Perhaps there is an other way to solve this.
Answer by kkiniaes · Dec 16, 2016 at 05:46 AM
Have you tried the following variable or function? https://docs.unity3d.com/ScriptReference/Material.SetTextureScale.html https://docs.unity3d.com/ScriptReference/Material-mainTextureScale.html
Answer by Kerosini · Dec 18, 2016 at 07:53 PM
No, I find it, but I had no idea for the first parameter "propertyName". Is "_MainTex" the name of the texture? I will test this now.
Thanks for your help.
Your answer
Follow this Question
Related Questions
Keeping the size of a texture constant across different 3D gameobjects 0 Answers
tiling texture dosnt work currently 1 Answer
So, tiling textures in UI Materials in not a thing? 0 Answers
Understanding Tiling and Offset in the Material Inspector 0 Answers
Material disappears after LoadScene 1 Answer