# SerializationException: Reference to ScriptableObject 'MyData' is broken or the object has been destroyed

- **ID:** `unity/scriptableobject-serialization-ref`
- **Domain:** unity
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A ScriptableObject reference in a MonoBehaviour or another ScriptableObject points to a destroyed or missing asset, often due to asset deletion, reimport, or scene unload.

## Version Compatibility

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

## Workarounds

1. **In the Inspector, locate the component with the broken reference and reassign the ScriptableObject asset from the Project window. If the asset is missing, recreate it (e.g., Assets > Create > MyData) and reassign.** (85% success)
   ```
   In the Inspector, locate the component with the broken reference and reassign the ScriptableObject asset from the Project window. If the asset is missing, recreate it (e.g., Assets > Create > MyData) and reassign.
   ```
2. **Use a custom Editor script to find and fix broken references: iterate over all serialized properties in the scene and check for missing assets using AssetDatabase.TryGetGUIDAndLocalFileIdentifier.** (75% success)
   ```
   Use a custom Editor script to find and fix broken references: iterate over all serialized properties in the scene and check for missing assets using AssetDatabase.TryGetGUIDAndLocalFileIdentifier.
   ```

## Dead Ends

- **** — Calling Resources.UnloadUnusedAssets() can destroy ScriptableObject references if they are not properly referenced, making the issue worse. (50% fail)
- **** — Simply saving the scene does not fix a broken reference; the actual asset must be reassigned. (40% fail)
