{
"unarmed":
{
"type":"melee",
"range":0.281,
"damage":1
},
"knife":
{
"type":"melee",
"range":0.381,
"damage":2
},
"pistol":
{
"type":"ranged",
"calliber":"handgun",
"firerate":1,
"damage":1
},
"shotgun":
{
"type":"ranged",
"callier":"buckshot",
"firerate":2.5,
"damage":5
}
}
-
file = new File();
file.Open("res://scenes/weapons.json",File.ModeFlags.Read);
string jSON = file.GetAsText();
Godot.Collections.Dictionary result =(Godot.Collections.Dictionary)JSON.Parse(jSON).Result;
GD.Print(result["unarmed"]["type"]);
I'm trying to access the subkeys {"type", "range","damage"}, but the collections only register the first keys, is there any way I can access them?