- Home /
Layering textures on top of eachother with dynamic positioning
So I have found this topic that has someone asking about layering a texture on to a model.
http://forum.unity3d.com/threads/texture-overlay-where-to-begin.141027/
Following that I was able to create a custom shader that can layer something on top of a models default texture.
That thread mentions that you could programatically position the layered texture. This is what I need to do and I can't for the life of me find anything about it. I understand that the texture offset should position the texture, but with the example in the above thread, the offset doesnt do anything for the second texture.
Also how would I do this using a script?
So any direction or tips or especially example code would be greatly appreciated.
Answer by Tim-Michels · Jun 13, 2014 at 02:45 PM
Have you tried:
go.renderer.material.SetTextureOffset("_NameOfSecondTextureProperty", new Vector2(0.5f, 0.5f));
Just make sure that the _NameOfSecondTextureProperty corresponds with the variable of your second texture that is in your shader. Let me know if it works ;)
Your answer
![](https://koobas.hobune.stream/wayback/20220613151404im_/https://answers.unity.com/themes/thub/images/avi.jpg)