This is the code I’ve used:
func _on_maze_body_exited(body):
get_tree().call_deferred("reload_current_scene")
The issue I’m having is that when I keep pressing down any of the keys I have assigned to make the space ship move, if it touches any of the “line” of the polygon maze that I’ve made, the game “resets itself” and returns me this error:
E 0:00:02:0768 reload_current_scene: Parameter "current_scene" is null.
<C++ Source> scene/main/scene_tree.cpp:1435 @ reload_current_scene()
If I don’t keep pushing down the "movement keys while I cross the lines the game does not give me any errors.
This is the image of my maze and lines I’m talking about:
I’m sorry for my english if my problem isn’t clear enogh let me know what’s not clear and I’ll do my best to explain it better.
Thanks in advance!