unity runtime_error ai_generated true

Serialization depth limit exceeded

ID: unity/serialization-depth-limit

Also available as: JSON · Markdown
78%Fix Rate
82%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2022 active

Root Cause

Circular reference or deeply nested data in serialized field.

generic

Workarounds

  1. 88% success Break circular references with IDs instead of direct references
  2. 90% success Use ScriptableObject for shared data instead of nested structs

Dead Ends

Common approaches that don't work:

  1. Increase depth limit 85% fail

    Not configurable in Unity, also masks design issue

  2. Mark all fields as NonSerialized 80% fail

    Loses data between sessions