Search Issue Tracker
Duplicate
Votes
0
Found in
2020.3
2020.3.13f1
2021.1
2021.2
2022.1
Issue ID
1350006
Regression
No
Scriptable Object references are lost when overwritten by FromJsonOverwrite
How to reproduce:
1. Open the user attached project "ProjectAnomaly.zip"
2. Enter Play Mode
3. In the Game view, turn Around with a mouse
4. Near a red house, you will see a blue character, go near him with W/A/S/D
5. Press "E" when a UI element pops up
6. Select "What's up?" dialogue option
7. Press the right mouse button to go through the dialogue
8. When you regain movement, exit Play Mode
9. In the Project browser search bar, enter "Case Records"
10. Select Scriptable Object "Case Records"
11. In the Inspector window, observe that there are 2 elements in the "Received Cases" called "Case Test (Case SO)"
12. Close and reopen the project
13. In the project browser select "Case Records"
14. In the Inspector window, observe the "Received Cases"
Expected result: There are the same 2 elements called "Case Test (Case SO)"
Actual result: There are no references
Reproducible with: 2020.3.13f1, 2020.3.15f2, 2021.1.16f1, 2021.2.0b6, 2022.1.0a5
Can't reproduce with: 2019.4.29f1 (Compiler errors)
Note:
-Delete the "Project Anomaly" folder from the persistent data path to reset the save files
-If the references are removed in "Case Records" and Play Mode is entered before reopening the project, the "Case Records" will be overwritten (loaded) properly
Note: the project uses JSONUtility to save an object in Playmode in the editor. Then it reloads the object in the editor with JsonUtility.FromJsonOverwrite. Currently, references to objects saved in Editor by JSONUtility will record the instance id of the object, which is not persisted, and hence will not point to the correct object again after the project reloads. Using EditorJSONUtility might be a workaround for JSON written from playmode in the editor, because it will record more complete reference information, but is not available in the player.
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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
This is a duplicate of issue #1342327