Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Andy-Block · Mar 22, 2013 at 11:39 PM · prefabduplicateprefab connection

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
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Andy-Block · Mar 23, 2013 at 09:12 AM 0
Share

I had a couple of further thoughts on this. Firstly, for the specific case I indicate above, I would maybe be better off using a single prefab and simply modifying the shader on the specific instances that need it - that way the 'common part' of the prefab would not need to be duplicated. However, for my case, I actually want to introduce a variety of differences between the prefabs, so that solution is not so convenient.

Secondly, I think a more elegant solution would be available if nested prefabs were supported (which I understand will be available in 4.X). Anyone happen to know when / what precise release it is due to land in?

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Loius · Mar 23, 2013 at 09:58 AM

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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Andy-Block · Mar 25, 2013 at 06:47 AM 0
Share

Ah, I see. $$anonymous$$akes 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!

avatar image Loius · Mar 25, 2013 at 08:26 AM 0
Share

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

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity: How can you make a prefab immutable for instance overrides 0 Answers

Changing a broken prefabs terrain material 1 Answer

prefab: can you exclude a variable from beign tracked? 0 Answers

Unity crashing after pressing CTRL D on gameobject or trying to make into prefab!? 0 Answers

Link to prefab breaks when recreating it 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges