- Home /
Question by
Oelbert · Jan 11, 2019 at 10:23 PM ·
buglistjsonargumentexceptiondeserialization
JSON deserialization
I just cant seem to get FromJson to work.
This is my Json file:
{
"Story": [
{
"Name": "Chapter01_01",
"StoryText": "It was a long time ago I've seen the daylight. I can see something shiny to my right. Might need to get closer.",
"QuestionText": "Should i get closer and further investigate?",
"Answers": [
"yes",
"no"
]
}
]
}
This is the way im trying to parse it:
var wrapper = JsonUtility.FromJson<JSONWrapper>(json);
I always get the error:
ArgumentException: JSON parse error: Invalid value.
UnityEngine.JsonUtility.FromJson (System.String json, System.Type type) (at C:/buildslave/unity/build/Modules/JSONSerialize/Public/JsonUtility.bindings.cs:50)
UnityEngine.JsonUtility.FromJson[JSONWrapper] (System.String json) (at C:/buildslave/unity/build/Modules/JSONSerialize/Public/JsonUtility.bindings.cs:33)
Container.Start () (at Assets/Container.cs:32)
Is there anyone that knows a fix? been googling the last 5 hours atleast.
Comment