Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Objects with 'HideFlags.HideInHierarchy | HideFlags.NotEditable' are still editable

Discussion in 'Scripting' started by JoePatrick, Dec 8, 2018.

  1. JoePatrick

    JoePatrick

    Joined:
    Nov 3, 2013
    Posts:
    55
    So I have an object that I don't want to be visible and don't want to be editable so I am setting the HideFlags as shown below however it's not working. The object doesn't show in hierarchy as expected but I can still click on the actual object in the scene view and move it, delete it etc. Am I doing something wrong?


    beltParent = new GameObject("Belt");
    beltParent.hideFlags = HideFlags.HideInHierarchy | HideFlags.NotEditable;
     
  2. JoePatrick

    JoePatrick

    Joined:
    Nov 3, 2013
    Posts:
    55
    Ok, it turns out I was actually clicking on the child objects as I had not set their hide flags as well