# Serialization depth limit exceeded. Consider increasing the Serialization Depth Limit in Project Settings.

- **ID:** `unity/scriptableobject-serialization-layout-change`
- **Domain:** unity
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

A ScriptableObject or MonoBehaviour has a deeply nested reference chain (more than 7 levels) that exceeds Unity's default serialization depth.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Unity 2022.3 | active | — | — |
| Unity 2023.2 | active | — | — |
| Unity 2021.3 | active | — | — |

## Workarounds

1. **Restructure your data to avoid deep nesting: flatten references by using IDs or asset references instead of direct object references. Example: replace `public List<ChildData> children;` with `public List<string> childGuids;` and load via Resources.Load.** (85% success)
   ```
   Restructure your data to avoid deep nesting: flatten references by using IDs or asset references instead of direct object references. Example: replace `public List<ChildData> children;` with `public List<string> childGuids;` and load via Resources.Load.
   ```
2. **Increase the serialization depth limit in Edit > Project Settings > Editor > Serialization Depth Limit to a higher value (e.g., 10 or 15).** (90% success)
   ```
   Increase the serialization depth limit in Edit > Project Settings > Editor > Serialization Depth Limit to a higher value (e.g., 10 or 15).
   ```
3. **Use `[System.NonSerialized]` on intermediate fields that don't need to persist, breaking the serialization chain.** (75% success)
   ```
   Use `[System.NonSerialized]` on intermediate fields that don't need to persist, breaking the serialization chain.
   ```

## Dead Ends

- **** — Simply increasing the depth limit in Project Settings can mask the issue and lead to performance degradation from deep serialization. (30% fail)
- **** — Adding [SerializeReference] to fields does not reduce the depth; it only changes how references are stored. (50% fail)
- **** — Removing all nested objects breaks the data structure and loses functionality. (70% fail)
