How can you duplicate a prefab and sever all links to the original?

I have a prefab set up (a single game object with various scripts and other components attached). I would like to create a second prefab that is identical to the first, except for the shader. What is the easiest way of doing this? I originally hoped to instantiate the prefab, then ‘break prefab instance’, rename it (or duplicate it), and create a new prefab from that object. However, although I end up with two prefabs, they seem to still be linked in some way; if I change the shader on one, it seems to get changed on both. I’ve also tried just copying the prefab on disk, but the resulting object appears white in the project view instead of blue, and appears to be unusable (dragging to the scene is not permitted).

Is there perhaps some way of severing all links of a prefab instance such that it will no longer be associated with the prefab at all? Or is there some other way of achieving what I need? Thanks in advance,

 Andy

1 Answer

1

Your method is correct, but materials are their own object. A mesh links to an existing material, and like as not your two prefabs are linked to the same material. You need to duplicate the material (and make changes as necessary) and assign the new material to the new prefab.

Ah, I see. Makes sense; I think it was the fact that the properties of the material were editable via the inspector of the object it was attached made me think that those settings were per object. Thanks!

Yeah, I've thought the same thing on multiple occasions and caught myself with exactly the same thing you were doing. :)