0 votes

I'm working on a level editor, and I think the best approach would to save it as a .scn file that a user can open. Is this possible? If so, can someone explain to me how and/or where I can find some code or a project to help me in the right direction?

asked Jan 16, 2018 in Engine by HarryCourt (161 points)

1 Answer

0 votes
Best answer

You can use the PackedScene and ResourceSaver classes to save a node and it's children into a .scn file.

var scene = get_node("Node")
var packed = PackedScene.new()
packed.pack(scene)
ResourceSaver.save("saved_scene.scn", packed)
answered Jan 16, 2018 by literalcitrus (480 points)
selected Jan 16, 2018 by HarryCourt
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 How to use this Q&A? before posting your first questions.