- Home /
Multiple sharedMaterial(s)
Okay, so I've been trying to get my game to switch out a texture for an object on a key press - I've finally done that, however it only changes the one texture, whereas my object has three different ones (each needing to be switched out with their alternative form).
You see, this is an interior wall, so it is decorated different on either side, with a two combinations available.
Is there a way to switch out all the textures with their alternate - so Wall2 Normal is switched with Wall2 Alternate, Wall1 Normal with Wall1 Alt, etc.
What I'm looking for is something other that .mainTexture, I guess.
Do you mean the material has three textures or that your object has three materials?
Also do you talk about one object? Or do you have multiple (sub)-objects? Do you see a hierarchy in the scene view? If there are child objects, do they have any renderer components? If it's only one object it could mean that you have a $$anonymous$$esh that contains submeshes and you have 3 $$anonymous$$aterials in the renderers $$anonymous$$aterial list. It's also possible that you use a shader that requires more than one texture (for example a diffuse texture and a normal map).
It would be great when you could be a little bit more specific when asking such a question. Feel free to edit your question
You could also add a screenshot of your Inspector viewing the object in question, if it's too hard to explain in words.
I think the Object has three materials, but each material has two textures to switch between.
@classic-niall: Don't post comments as answers. Answers should answer the question. Please watch the new tutorial video on how to use Unity Answers
I've converted your answer into a comment.
Well, if the material has 2 textures it depends exclusively on what shader you use. The shader specifies how many textures it needs and what the parameters are called.
This might help.