ignores script variables

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

I am saving a scene to disk by packing it using PackedScene.pack(node) and then, packed_scene). However, the resulting .tscn file doesn’t contain any info on script variables, e.g. i have var type = 5 in a script inside the scene I just packed, but when loading the scene using ResourceLoader.load(), that “type” variable is unset. And the .tscn file itself (which is a text file) doesn’t have any info about the “type” variable.
I want to be able to save info about script varaibles. I know there is a way to save your scenes by writing all data to a json file manually, but I want to avoid that as much as possible.