0
\$\begingroup\$

I have two identical objects in my Unity scene. When I change the texture of one, the texture is changed on the other, almost as though the first one is a prefab. Why is this happening and how can I treat them independently?

Steps taken:

  • Import .obj file and two .png files
  • Drag object into scene
  • Look at the object in the hierarchy (where the list of all objects in the scene is)
  • It has a child called pSphere1
  • pSphere1 has a mesh renderer with 2 materials on it - RedGold and pSphere1Mat
  • It also has two components controlling each of these materials
  • In those control components, I can select a shader from the dropdown and I can also select a texture.
  • For either one of them, if I change the texture say to PolkaDots, both objects have their materials changed, instead of only the one I am working on.

two RedGold balls, how do I make one PolkaDot?

\$\endgroup\$
  • \$\begingroup\$ Both use the same material? \$\endgroup\$ – bummzack Oct 7 '14 at 12:38
  • \$\begingroup\$ @bummzack added an image to try make it clearer \$\endgroup\$ – lofidevops Oct 7 '14 at 12:48
  • \$\begingroup\$ The image doesn't help much. But the reason for your problem is most likely that both objects use the same material... \$\endgroup\$ – bummzack Oct 7 '14 at 12:58
2
\$\begingroup\$

If you modify a material, it affects the objects that are using it. You need to duplicate that material, modify its texture and reassign it to the target object.

\$\endgroup\$
  • \$\begingroup\$ Thanks that explains a LOT! My only difficulty now is that I don't know how to duplicate material. I have located it in my project, but when I right-click, I don't see a way to duplicate? Do you mind expanding your answer? \$\endgroup\$ – lofidevops Oct 7 '14 at 13:39
  • \$\begingroup\$ (All I have access to is the .obj and .png files from the artist so I can't just reimport and give it a different name) \$\endgroup\$ – lofidevops Oct 7 '14 at 13:40
  • 1
    \$\begingroup\$ @d3vid Just create a new one and apply the new properties to it. If you have further problems, ask a new question. \$\endgroup\$ – MichaelHouse Oct 7 '14 at 13:50
  • \$\begingroup\$ trying it out based on docs.unity3d.com/Manual/Materials.html and docs.unity3d.com/Manual/class-Material.html \$\endgroup\$ – lofidevops Oct 7 '14 at 14:06
  • 1
    \$\begingroup\$ select the material from your object browser and perform copy paste. it will duplicate the material and identify the new object as "<material name>(1)" \$\endgroup\$ – Alican Oct 7 '14 at 14:18

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