[Solved] Load and use json file

Hey guys! I’m new to GDevelop and I’ve been having a great time learning how to do all kinds of stuff!

What I want: to happen: I want to change scene variables to the ones in my JSON file.

Problem: I’m stuck on how to load a JSON file and using it to change scene variables.

This is my example JSON file:

“fruit”: “Apple”,
“size”: “Large”,
“color”: “Red”

I’ve looked at different tutorials and forum posts, but I can’t seem to find a way to make it work.
If any of you could help me with this problem that would be great!

You can load a JSON into a scene variable then act in kind.
Network → Load JSON into a scene variable.

1 Like

Thanks for your reply!

If I’m not mistaken this will allow me to write a JSON string into GDevelop and store it into a variable. I was wondering if I could do the same thing as You’ve mentioned but instead of having to type the JSON string have it read from a JSON file?

Hi, yes thats correct here is an example and other here from JSON API

1 Like

Thanks! I think I got it working now!