Topic was automatically imported from the old Question2Answer platform.
Asked By
MemokingMH
MenuButton function is working but RestartButton function is not working.Why is it not working.Also this is stop menu scene and I’m putting it in every level
What do You mean no error ? No error in console ?
reloadcurrentscene returns information on why the scene could not be reloaded. Just print(reloadcurrentscene())
It’s not allowing me to print a function
The method “reload_current_scene” isn’t declared in the current class.
MemokingMH | 2021-03-24 16:28
You weren’t supposed to print it literally, You repeated my typo’s
Look at the function You used in documentation. It says it returns ERROR when something goes wrong. It says, that there are 3 possible errors when scene does not reload - no current scene defined, impossible to instantiate scene, impossible to get packed scene. You need to use print to get and read this error. SOmething like this :
If get_tree().reload_current_scene() == 1:
print("error nr 1")
elif get_tree().reload_current_scene() == 2:
print("error nr 2")