Search Issue Tracker
Fixed in 2020.2.X
Fixed in 2019.3.X, 2020.1.X
Votes
1
Found in
2018.3
2019.3
2020.1
Issue ID
1216914
Regression
Yes
Prefabs lose their values if scripts are removed then reintroduced
To reproduce:
1. Create a Monobehaviour Foo with a single int field
2. Create an empty object in the scene and add the Foo behavior to the object
3. Set the components field to 12
4. Create a Prefab from the object
5. Close the Editor
6. Move the Script to a folder outside the project
7. Delete the library folder
8. Open the project in the editor
9. Select the Prefab in the Project view
10. Notice the Inspector says "Prefab is missing script"
11. Copy the Script into the project (and refresh, if autorefresh is disabled)
12. Select the prefab and see the field value
Expected result: The field value is '12'
Actual result: The field value is '0'
Reproducible in: 2018.4.10f1, 2019.2.7f2, 2019.3.0b5, 2020.1.0a6
Note: Reimporting the Prefab will fix the issue
-
DanielSnd
Mar 17, 2021 01:58
Not resolved. Just had this exact problem in 2019.4.21f1
-
tcz8
Apr 01, 2020 17:19
The point of LTS versions is to work on a bug free code base. Why you don't patch them ASAP is a total mystery to me. Who does any serious work on the alpha versions?
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- SerializedPropertyChangeEvent is invoked when initially binding PropertyFields in custom Editor
- UI Panel is not visible when HDR and STP filter are enabled
- Crash on GfxDeviceD3D11Base::DrawBuffersIndirect when opening a specific project
- OnTriggerExit2D is called in Play mode when undoing component adding
- Builds fail with "Execution failed for task ':launcher:checkReleaseDuplicateClasses'" error when the newer version of the In-App Purchasing package is installed on a specific project
Resolution Note (fix version 2020.2):
Fixed in 2020.2.0a11
Resolution Note (fix version 2020.1):
Fixed in 2020.1.0b10
Resolution Note (fix version 2019.3):
Fixed in 2019.3.15f1