Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
14
Question by Ted-Brown · Jun 14, 2013 at 07:25 PM · editorprefabchildprefabutility

Safely deleting a child of a prefab

This is with Unity 4.1.3f3

I have a prefab with multiple child objects. One of those objects needs to be deleted. Selecting the child object, right-clicking, and selecting "Delete" does nothing.

I can "re-create" the prefab without this child object by pulling it into the scene, deleting the child object in the scene hierarchy, deleting the prefab in the project view, then re-creating the prefab by pulling it from the scene.

However, this breaks all Inspector links referencing this game object, so it's not OK.

How can I safely delete a child object of a prefab, with "safe" defined as "not breaking inspector links"?

Comment
Add comment
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

1 Reply

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

Answer by whydoidoit · Jun 15, 2013 at 07:41 AM

Put the prefab in a scene, delete the child object, select the prefab instance in the hierarchy and click "Apply".

Note that indeed, even after you "break the prefab instance", the "Select" "Revert" "Apply" buttons DO STILL APPEAR. Strange but true.

alt text


screen shot 2013-06-15 at 08.40.56.png (11.3 kB)
Comment
Add comment · Show 10 · 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 Ted-Brown · Jun 17, 2013 at 05:27 PM 2
Share

Oh wow. That... that is terrible UI design on Unity's part. =) Deleting a child object in a scene breaks the connection to the prefab, so the natural expectation is that "apply" would no longer work, because there is no connection!

However, this worked perfectly. Thank you!

avatar image pea · Nov 11, 2013 at 09:37 AM 0
Share

Whoa, yeah. Teeeeerrible UI. Glad to read that you can actually do this though!

avatar image Demonicdaron · Aug 10, 2015 at 02:01 PM 0
Share

Just to confirm the UI bug, and to confirm the correctness of @whydoidoit 's answer

avatar image ovrdb · Sep 22, 2015 at 04:14 PM 0
Share

Really bad and misleading, Unity... but thanks for the info! It works!

avatar image Fattie · Nov 28, 2015 at 06:29 PM 0
Share

It has to be one of the weirdest things in Unity. I clicked "Reward User" and you should too! :)

Show more comments

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

22 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to properly edit prefabs with child elements? 1 Answer

Need to make a reference in a prefab to itself not to the created instance 2 Answers

Why does CreateEmptyPrefab return null? 1 Answer

Make a simple tree 1 Answer

Editor Script: Linking GameObjects to public script variables resets when playing. 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