Skip to content

Instantly share code, notes, and snippets.

Last active June 13, 2023 06:12
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Shows all GameObjects in the scene with hideFlags, so you can debug them.
using UnityEngine;
using UnityEditor;
public static class HideFlagsUtility
[MenuItem("Help/Hide Flags/Show All Objects")]
private static void ShowAll()
var allGameObjects = Object.FindObjectsOfType<GameObject>(true);
foreach (var go in allGameObjects)
switch (go.hideFlags)
case HideFlags.HideAndDontSave:
go.hideFlags = HideFlags.DontSave;
case HideFlags.HideInHierarchy:
case HideFlags.HideInInspector:
go.hideFlags = HideFlags.None;
Copy link

zangad commented Jun 13, 2023

This is excellent, thank you! I had a couple of hidden prefab objects in my scene that had broken references, and since they were hidden, I could never see them in the hierarchy. This worked perfectly to show them and let me delete them. Thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment