Load JSON Scriptable Object and Prefabs

Hello! I am using the Built-In unity JSON parser (to save and load).


The data is created correctly for everything except prefabs and scriptable objects. The JSON file seems to save the objects via their InstanceID. When the Unity project is then closed, saved, moved onto another computer, and reopened (the same project) then the InstanceIDs are changing (sometimes) and the JSON loader just loads null.


I am at a loss as to how to solve this problem, any help would be greatly appreciated.


Thank you for your time!

Solution: When using JSONUtility in Editor code, you EditorJSONUtility instead of JSONUtility. This is causing another problem though when trying to actually use the JSON in game