Having problem with reload current scene

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

I’m struggling with reload_current_scene() function. I use it when my player collide with a bullet from my enemy to restart the level at the beginning. However when I test the game the scene did not restart, it freezes at a random position and I can no longer control anything, as my player disappeard. How can I fix this problem?
Note: I created seperate scenes such as player scene and enemy scene and then drag them to my level scene during the desigining level step

I doubt anyone will be able to help you from that description alone. Can you provide your code or an example project? Are you getting any errors or warnings in the debugger? Also note that relaod_current_scene returns an Error - did you check if its value is something else than OK? If so, what is it?

njamster | 2020-05-15 09:52

:bust_in_silhouette: Reply From: modev

i think the code for reloading the scene is get_tree().reload_current_scene()

get _ tree() reload _current _ scene()