Refresh button to reload the level (scene) just reloads n its stuck!!!

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By yeeshu06
:warning: Old Version Published before Godot 3 was released.

Good day,

I made a texture button (refresh) to reload the scene if the player wants to start again… and it does load the scene, but its stuck. It does not want to play. any ideas?

here is simply what i did:

extends TextureButton

func _ready():
	connect("pressed",self,"_on_pressed_refresh")

func _on_pressed_refresh():
	get_node("/root/global").setScene("res://SecondScene.tscn")

there isn’t such setScene method. did you make it?

volzhs | 2017-05-30 17:41

:bust_in_silhouette: Reply From: volzhs

there is SceneTree.reload_current_scene() method.
you can use it by get_tree().reload_current_scene()