0 votes

I am very new to GODOT and using the latest builds of the version 3 RC of the engine so I don't feel qualified to post issues to the developers in case I just did not understand how to do stuff.

I load a JSON file that works OK in C# using this function (but nothing that I test with JSON.parse gives me any non-error output) :

func load_data():
# JSON parsing not working!
var file = File.new()
file.open("res://Data/game.json", file.READ)
var json = file.get_as_text()
var json_result = JSON.parse(json)
if json_result.error != 0:
    print("JSON parse error on line: " + data.error_line)
    data = json_result.result
in Engine by (72 points)

What does your JSON file look like?

I tested with a variety of JSON text such as: {"a": 1} The result is errorline 0 and empty errorstring.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.