Pesquisar este blog

Adicionar e excluir cenas - GD SCRIPT

 var cena1 = preload("res://cena1.tscn").instance()

var cena2 = preload("res://cena2.tscn").instance()



func _on_Button_pressed():

###exclui a cena

get_node("/root/cenaprincipal").queue_free()




func _on_Button_pressed():

####add a cena carregada na variavel

get_tree().get_root().add_child(cena1)

pass # Replace with function body.