"Invalid call. Nonexistent function 'keys' in base 'Array'."

Godot Version

4.2.2

Question

First time being here. I already know why this error is happening, can anybody recomend a fix, I’m triyng to make an inventory system like re4’s using this tutorial: https://www.youtube.com/watch?v=WN40PrPRDXs
Everything else works fine, exept for this:

extends Node

var item_data = {}
var item_grid_data := {}
@onready var item_data_path = “res://data/json/items.json”

func _ready():
cargar_data(item_data_path)
setear_data_de_grilla()

func cargar_data(path):
if !FileAccess.file_exists(path):
print_debug(“ERROR. Archivo de data no encontrado.”)
var item_data_file = FileAccess.open(path, FileAccess.READ)
item_data = JSON.parse_string(item_data_file.get_as_text())
print(item_data)

func setear_data_de_grilla():
for item in item_data.keys():
var temp_grid_array :=
for point in item_data[item][“Gilla”].split(“/”):
temp_grid_array.push_back(point.split(“,”))
item_grid_data[item] = temp_grid_array
print(item_grid_data)
Like I said I already know why this is happening, but I can’t find a solution, any help?

I figured it out, it was my json, the json exporter that I have on my google sheets is stupid.

1 Like