# InvalidOperationException: It is not allowed to create a ScriptableObject from the constructor

- **ID:** `unity/scriptableobject-constructor-called`
- **Domain:** unity
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 93%

## Root Cause

A ScriptableObject instance was created using the 'new' keyword in a constructor instead of ScriptableObject.CreateInstance.

## Version Compatibility

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

## Workarounds

1. **Replace 'new MyScriptableObject()' with 'ScriptableObject.CreateInstance<MyScriptableObject>()'.** (98% success)
   ```
   Replace 'new MyScriptableObject()' with 'ScriptableObject.CreateInstance<MyScriptableObject>()'.
   ```
2. **If you need to initialize fields, create a static factory method that calls CreateInstance and then sets properties.** (95% success)
   ```
   If you need to initialize fields, create a static factory method that calls CreateInstance and then sets properties.
   ```

## Dead Ends

- **** — ScriptableObject must be created via CreateInstance, not by new, regardless of serialization attributes. (95% fail)
- **** — ScriptableObject requires explicit initialization via CreateInstance to set up internal Unity engine state. (85% fail)
