Hello, Does anyone know what happen to to_json() in GD4? I tried saving game tutorial with

func save():
...
var json = to_json(data)
file.store_line(json)

but I got error function "to_json()" not found in base self. (code is attached to a NOD3D). The latest doc shows the function is still usable but the search from editor shows no result.

cybereality

Thankyou. I was double checking with the latest save game tutorial and to_json() is still there so I guess they have not updated yet.

I got the save working with this

func save():
	var data = {
		"player" : $Player.to_dictionary()
	}
	var json = JSON.new()
	var json_string = json.stringify(data)
	var file = File.new()
	file.open("user://savegame.json", File.WRITE)
	file.store_line(json_string)
	file.close()

The docs have only been updated for the API. I think all the tutorials are very old.