I have two different scenes with a script attached to both of them.
scene 1:
var dict = {}
func _ready():
pass
func _on_text_entered(text): #signal
dict[1] = text
func _on_button_pressed(): #signal
print(dict) #this prints changed dictionary ("{1,"entered text"}")
get_tree().change_scene("res://scene2.tscn") #change to scene 2
scene 2:
func _ready():
print(scene1.dict) #this prints empty dictionary ("{}")
So basically variable (dict) is changed in scene 1 using a signal. But when I try to access the same variable from scene 2, it is unchanged and returns original empty dictionary. Scene 1 is globally autoloaded in project settings
How can I fix that problem?