Code:
func _ready():
for i in PlayerData.inv_data.keys():
var inv_slot = $InventoryBack.get_node(i)
print(PlayerData.inv_data)
if PlayerData.inv_data[str(i)][“Item”] != null: //error line
var item_name = GameData.item_data[str(PlayerData.inv_data[i][“Item”])][“ItemName”]
var icon_texture = load(“res://Assets/Items/ID” + str(PlayerData.inv_data[i][“Item”]) + “.png”)
inv_slot.get_node(“Icon”).set_texture(icon_texture)
in which line there is this error ?
this could be your Player.inv_data[index] value is a String type, instead of what you wanted it to be a Dictionary type
yes, your issue is there are these inv values that has Dictionary with Item as key, some just pure string of “0”
the way you organize the inventory’s inv data may be wrong