- Home /
Changing a normal or any other kind of map from a script?
I know you can change the main texture using material.mainTexture, but is it possible to change another map like a normal map or maybe specular map and so on...
Also how can I get a texture's resolution?
Thanks
Answer by Bunny83 · Mar 01, 2011 at 04:12 AM
Just use Material.SetTexture(). The texture names are shader dependent. Most shaders use the same names but you can't really rely on that. _MainTex and _BumpMap should work in most cases but only if the shader provide this properties. You can use Material.HasProperty() to check for a specific parameter.
A Texture has two properties for the resolution: width and height.
Your answer
![](https://koobas.hobune.stream/wayback/20220613110753im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Some objects show up as shadeless 1 Answer
Get Material of Normal? 0 Answers
Should I use a material for each sprite? 0 Answers