7
\$\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\$
  • 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\$ – MichaelHouse Sep 16 '14 at 20:23
  • \$\begingroup\$ Yes, that's the reason, some prefabs have the same shader, and I'm modifying a material. Thanks. \$\endgroup\$ – optimusfrenk Sep 16 '14 at 21:11
8
\$\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\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.