change scene and keep the progress of an instantiated scene

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

Hi, I’m new to this, what I want to do is that when I change a scene, the progress of an instantiated scene is shaken, this is the code of the scene that I want not to be updated at the time of changing the scene.

var vida = 1

func _ready():



func _on_1_pressed():
if (vida ==1):
vida += 1

func _on_bbb_pressed():
get_tree().change_scene(“1 - copia (19).tscn”)

:bust_in_silhouette: Reply From: null_digital

An easy way would be to have a script in AutoLoad to hold the vars you don’t want to lose in scene changes.