Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | nonomiyo |
Hello ! Thanks to ICatRegister, I now have a thread loading my ingame scene like that :
thread.start(self,"prep_scene", ResourceLoader.load_interactive("res://scenes/ingame.tscn"))
func _on_load_level_done():
var level_res = thread.wait_to_finish()
var scene = level_res.instance();
goto_scene(scene);
func goto_scene(new_scene):
current_scene.queue_free()
current_scene = new_scene
get_tree().get_root().call_deferred("add_child",current_scene)
.
It all works perfectly fine. It launches the ingame scene, but then my restart button, set in the ingame scene’s script, doesn’t work anymore :
func on_restartbutton_pressed():
get_tree().reload_current_scene()
I’d like it to reload the ingame scene but it looks like my ingame scene is not recognize as “current_scene”.
do you know what I could replace this command with ?
thanks !