Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Linc_T_G |
Here is the function that tries to access the dictionary:
remote func Get_Player_Level():
var sender_id = get_tree().get_rpc_sender_id()
var s_data = Json_Reader.Player_Data[Player].Level
rpc_id(sender_id, "Returned_data", s_data)
And here is the code that translates the JSON file to a dictionary:
extends Node
var Player_Data
func _ready():
var Player_data_file = File.new()
Player_data_file.open("res://Assets/Data/Player_Data.json", File.READ)
var Player_data_to_json = JSON.parse(Player_data_file.get_as_text())
Player_data_file.close()
Player_Data = Player_data_to_json.result
I get the error :
The Identifier “Player” isn’t declared in the current scope.