When debugging field values in Unity, you probably look at its value in the inspector. But what if your field is private? You probably print its value in the Update() loop or change it from private to public, and then change it back.
What if I told you there was a better way to check private field values without changing and recompiling your code?
Imagine your script defines these variables:
public string publicString;
private string privateString = "secret";
[SerializeField] private string serializedString;
To check the value of “privateString”, just click on the three dots in the top right corner of your inspector window, then select "Debug”.
Now you can see your private fields! No more changing your code to turn your private variables public and back and no more excessive debug logs!
I have shared this tip with so many people who have been using Unity for years. I hope you find this useful as well.