I am trying to change my scene but after it is changed once it never works again, why is this?

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

So im making a 2d platformer and followed a tutorial to make the scene reload once you fall inside an area 2d it works perfectly but only once, if i try to drop my character to there again it will just continue falling like it isnt there, why is this?

My code is
var k
func _on_Fallzone_body_entered(_body):
k=get_tree().change_scene(“res://Level1.tscn”)

Is the function getting triggered when the player falls in? Did you connect the signal when you changed the scene?

exuin | 2021-05-03 02:21

:bust_in_silhouette: Reply From: magicalogic

You can just use get_tree().reload_current_scene() if all you want is to reload the scene.