8
\$\begingroup\$

I'm working on a Unity's Project and I want to modify a prefab, more precisely I want to change the texture of a prefab. The problem is that my modification is applied also to other prefabs. I read on the documentation how each of the buttons labeled Select, Revert and Apply works, and what I understood is that the modification should update only the selected prefab.

Here is the Prefabs' Manual which I read.

What am I missing?

PS: I'm not the author of the project, I have to apply some modifications only.

\$\endgroup\$
2
  • 3
    \$\begingroup\$ It's more likely that you're modifying the material the prefab is using, and other prefabs using that material are being affected. Can you describe in more detail what you're doing to the prefab? \$\endgroup\$
    – House
    Commented Sep 16, 2014 at 20:23
  • \$\begingroup\$ Yes, that's the reason, some prefabs have the same shader, and I'm modifying a material. Thanks. \$\endgroup\$ Commented Sep 16, 2014 at 21:11

2 Answers 2

10
\$\begingroup\$

It's more likely that you're modifying the material the prefab is using, and other prefabs using that material are being affected. While you are correct that what you're doing shouldn't modify the other prefabs, those prefabs still share a reference to the same material. When modifying a material, it affects all objects and prefabs that reference that material.

You should make a copy of the material and reference the copy from the prefab you want to modify.

\$\endgroup\$
1
\$\begingroup\$

Copying over the prefab file will also copy the mesh renderer component including the materials it references.. if you go to that mesh renderer component in the copied prefab asset you should be able to change the referenced materials without affecting the orignal prefab

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Note that the user's problem (six years ago) was due to trying to change a texture on the material, not trying to change which materials are referenced by its renderer as you describe here. \$\endgroup\$
    – DMGregory
    Commented Mar 26, 2020 at 21:20
  • \$\begingroup\$ This comment helped me to figure out what was actually going on behind the scenes - I thought changing the shader was changing the material!!! TYVM, this was huge for me! \$\endgroup\$
    – DrCord
    Commented Mar 7, 2023 at 18:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .