Hi, i am trying to make and inventory system, i get the item data from a Dictionary composed of other Dictionaries, like this:
var item_list : Dictionary = {
"0": {"name": "sword", "attack": 2, "defense": 0},
"1": {"name": "shield", "attack": 0, "defense": 1}
}
Then i need to pass those values to the item instance, like this:
var item_id : String = "0"
var item_info : Dictionary = item_list[item_id]
This isn't working, i get the error: Invalid access to property or key '0' on a base object of type 'Dictionary'
When i print(item_list[item_id]) it works fine, i just can't define the value of item_info