I am using SetTexture to change a material’s texture at runtime and everything is working great. My problem is that some of my models have multiple materials and it is not always the first material’s texture i need to change.
How can I access a model’s second material or third etc and use SetTexture to change them?
Thanks Jessy and sorry for even asking the question… i looked in the scripting reference and didn’t even see renderer.materials! My fault, i was using renderer.material
If you definitely have more than one material on an object, you could use:
renderer.materials[1] to get the second material for example. If that doesn’t work you’re doing something else wrong, if that’s the case could you post what error you’re getting?