- Home /
Is it possible to change the shader of a group of object ?
Hi, I would like to switch from Diffuse to Transparent/Diffuse the shader of all the part of my building (once I click on the building). Is there any way to do it for a group of object, or do I need to do it one by one ?
Answer by Julien-Lynge · Jun 11, 2012 at 04:09 PM
If you assign the same material to all the objects in the building, you can adjust the sharedMaterial rather than the material for an object, and this will update every other object that shares this material.
Be cautioned: this will require that you set up a different material for each building, even if the materials are identical, unless you want all of your buildings becoming transparent together. Having more materials in a scene will mean that Unity can't batch the scene as efficiently, so the scene may run at a slightly slower FPS - but if you don't have hundreds of different materials it probably won't be noticeable.