Essential Attributes [NotDefault]
Detect and highlight serialized fields with default values — includes red visual indicators in the Inspector and error logs in the Console.
by Foxal Face
Price History +
The [NotDefault] attribute helps catch uninitialized or forgotten fields in your serialized data. It highlights any field that still holds its default value (e.g., 0, null, Vector3.zero, etc.) with a red outline in the Inspector, making it easy to spot at a glance, and logs a clickable error in the Console to guide you directly to the issue.
It works recursively with nested serializable classes and structs, and supports arrays/lists with fine-grained control over what is checked:
- Just the array/list container
- Just the elements
- Or both (using ArrayTarget)
Error detection is triggered automatically when components are loaded, modified, or displayed — but you can also manually trigger or clear errors from the Tools menu. To optimize performance, you can disable automatic checking and only validate on demand.
💡 Try Before You Buy
This attribute is also included in the Essential Attributes asset — or try [ElementName]and [TexturePreview] for free on the Unity Asset Store.