Search Unity

  1. Unity 2019.1 beta is now available.
    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. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. 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