throws the current code into an exception:
private string JSONLoadName;
void TestJSON()
{
var TestJson = new Godot.File();
TestJson.Open("JsonFiles/Test.json", File.ModeFlags.Read);
string dataText = TestJson.GetAsText();
JSONParseResult result = JSON.Parse(dataText);
Godot.Collections.Dictionary scenario = result.Result as Godot.Collections.Dictionary;
try
{
JSONLoadName = scenario["Name"] as string;
GD.Print($"Debug {JSONLoadName}");
}
catch
{
GD.Print("Error JSON File!");
}
TestJson.Close();
}
JSON file code:
null = {
"Name": "Ivan",
}
What are your ideas for solving the error?