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
3
Question by disruptive · Jun 06, 2014 at 07:21 PM · prefabunityeditordrag-and-drophideflags

HideAndDontSave not preserve when creating Prefab

HideAndDontSave does not work when creating Prefab...

In Unity 4.5, I have a problem where a GameObject with the flags: HideAndDontSave shows up in the hierarchy.

I have an editor extension that allows to pick a component that can be dragged into the project panel to create a Prefab. The simplified code looks like so:

 void CreateDragAndDrop(string new_object_name)
 {
                 GameObject go= new GameObject(new_object_name);
                 go.hideFlags = HideFlags.HideAndDontSave;
                 DragAndDrop.PrepareStartDrag();
                 DragAndDrop.objectReferences= new UnityEngine.Object[1]{go};
                 DragAndDrop.StartDrag(new_object_name);
                 MemoryPool.DelayedDestroy(go);       // This service will destroy the object after it is not used for a period of time.
 }
 

In the Hierarchy...

When the drag is performed and ended inside the project panel, a Prefab is created but the GameObject is also visible in the hierarchy.

I can understand that the Prefab clones the 'go' but why does it now show in the hierarchy?

TAGS: Prefab, HideFlags, HideAndDontSave, DragAndDrop

NOTE: I had to put the TAGS in the text because the system does not allow me to create new tags and believe it or not Prefab does not exist; HideFlags does not exists; DragAndDrop does not exists ..... This is to wonder if we are in the Unity forum !!!

Comment
Add comment · Show 4
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 Ipsquiggle · Jul 30, 2014 at 05:52 AM 0
Share

Same issue here.. is this a new problem in 4.5? Did you ever find a resolution? It seems to me this is a bug and should be reported to Unity.

avatar image Ipsquiggle · Jul 30, 2014 at 05:55 AM 0
Share

Also, fixed your tags there. :) No idea what was up with that, they appeared fine for me.

avatar image vexe · Jul 30, 2014 at 05:56 AM 0
Share

@disruptive tags don't start with a capital letter if that's what you tried.

avatar image forestrf · Nov 09, 2019 at 02:09 AM 0
Share

Still happening on Unity 2017, so necroposting is adecuate here.

0 Replies

· Add your reply
  • Sort: 

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

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

Related Questions

Can't drag GameObject from Hiearchy to Project view to create prefabs on Linux unity 5.5.1 1 Answer

Why does my prefab create a child by itself in ProjectView 0 Answers

Script is being applied to each prefab instead of one 1 Answer

How To Make GUI/Dragable Object - Att: Video 3 Answers

prefab rendering on top of its parent? 0 Answers


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