- Home /
Custom Team Colour Materials
Hello, I am using a shader that allows me to change parts of a texture to the material colour. This works great. The problem is when I change the material colour, all instances of my player object change colour, thus making everyone seem like they are on the same team (same colour).
Now the possible solution I thought of was to have a few versions of my material, called "Team 1 material", "Team 2 material" and so on. This would allow me to change team colours separately. This poses two problems, however. First, the number of teams gets restricted by the number of materials I have. Second, my character objects have LOTS of meshes (most of which use the same material). This poses a problem with how would I replace all of the materials at runtime (do I have to hard-code all mesh names?!).
To summarize:
Can I have material colours per instance of prefab, rather than instance of material?
If I cant, how can I replace all instances of a material in a prefab to another material without hard-coding all mesh names?
Your answer
![](https://koobas.hobune.stream/wayback/20220613110832im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Changing the Material of an instance of a prefab only! 2 Answers
can't render blender materials!?!?! 4 Answers
how to make textures the same size regardless of object size unity 0 Answers
Static Objects and and terrain detail turn white upon opening scene? 0 Answers
Materials losing their texture after copying another material. (Possibly a bug) 1 Answer