Unity’s debug option for the inspector is one of the small, but hugely important features. Here’s how to find it:

In the tab dropdown for the inspector chose the Debug option, or Normal to return to defaults.

Now the Inspector will show additional information, such as private variables from scripts like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
using UnityEngine; public class Player : MonoBehaviour { //Inspector variable that can be tweaked by a designer public int maxHealth; //Public property that can be accessed by other scripts, //but is not tweakable from the Inspector public int Health { get { return health; } set { //Include a test if necessary if(value >= 0 && value <= maxHealth) health = value; } } //Private backing field to store values from our Health property private int health; void Start() { //initialize fields Health = maxHealth; } } |
This is one of the easiest and most comfortable ways to inspect private fields from custom classes. Note, that inspector cannot show everything you might expect it to:
The Debug Inspector does not show properties or static variables.
Just to make sure: The Health field that is shown in the inspector is in fact our private variable health, not the property. Variable names are automatically capitalized and formatted in the inspector.
Quicktip: Use auto-implemented properties, if you don’t need additional code or special names for your backing fields. See this tutorial, if you need to freshen up on how properties work.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
using UnityEngine; public class Player : MonoBehaviour { public int maxHealth; public int Health {get;set;} void Start() { Health = maxHealth; } } |
Here is the official C# documentation on auto-implemented properties.
Be aware that these “auto-props” will display with a particular name syntax in the debug inspector:

The Debug Inspector shows not only private fields on custom scripts, but detailed options for other components.
There are many ways to use the debug option to inspect hidden data or change advanced options on Unity components. Here are a few examples:
Inspector and project browser icons
The debug inspector also works when browsing assets in the project view. If you like, you can assign custom icons to your components. This can help your team to find certain important scripts more easily or if you’re developing your own custom component you might want to give it a branding.



Advanced animation options
There are several options hidden for animation clips, some of which can come in handy to change, such as the ability to switch to legacy animation, when not using Mecanim. You can also adjust options from this window, instead of switching to the Animation or Animator window (e.g. Sample Rate).

Compare objects by instance id
Sometimes you run into a problem, where an object’s instance ID can help you to debug your scene. (The instance ID is a unique identifier to any object in the scene.) Here is a simplified example to illustrate the use of instance IDs:
Often, you need scripts which persist between scenes, such as GameControllers or AudioManagers. If, for whatever reason, you want your manager class to be a MonoBehaviour that lives on a GameObject in the scene, you will have to make sure that there can only exist one instance of it during runtime (read up on the Singleton Pattern for more).
Usually there are ways to build objects in a way that they are true, problem-free singletons, but sometimes you’re stuck with a solution that is prone to errors:

Think of a case, when you have a GameController and due to human error there are multiple instances of it attached to GameObjects in the scene. Instance IDs can give you detailed information about which objects are involved when you run into problems:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
using UnityEngine; public class GameController : MonoBehaviour { public static GameController instance; void Awake () { if(instance == null) { instance = this; } else if(instance != this) { Destroy(this); Debug.Log ("Instance was destroyed: " + this.GetInstanceID()); } } void Start () { Debug.Log ("GameController used: " + this.GetInstanceID()); } } |
Now, if you end up with multiple instances of the GameController, only the first one survives. Additionally, the instance IDs of both objects are printed out, to show you exactly which of the instances in the scene caused the problem.
As stated above, this example is purposely plain. Real-world scenarios, where instance IDs will save your life, are going to be complex and cumbersome to debug without the help of detailed object information.
—
These were only a few examples of how to make the most of the debug inspector in Unity. Keep your eyes open for hidden options and information that helps your work.