Does anyone know about saving level.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Shub_r16

So I’m just testing out saving, I have a project where there are multiple levels and you have to answer question to unlock the next level. For example

(I made a global script which had the variables)
var Q1 = null
var Q2 = null

(gamescript)
func _process(delta):
if Global.Q1 == 4:
get_node(“Next”).disable = false #Allowes you to proceed to the next level

(Level_menu_script)
func _process(delta):
if Global.Q1 == 4:
get_node(“L2”).disable.false #this is the level menu and unlocks the next levels

#SO THE quesion is how do i store the information thats in global file into a seprate file because when ever i leave the game an
go back into it the level locks its self again.

:bust_in_silhouette: Reply From: PunchablePlushie

You can look into saving and loading data. Here’s a quick ~3min video on how you can use JSON files to save and load data for the game:

Here’s a more detailed video:

You can also just search on YouTube or Google to find more resources. There are tons of useful articles and videos on the matter.

Finally, I also recommend you to checkout the documentation page for the File class and the JSON class.