fix erreur

This commit is contained in:
Lucas 2024-07-24 23:43:32 +02:00
parent 705399271d
commit eb791059cd

View file

@ -9,7 +9,7 @@ var player
func transition_to_scene(new_scene: PackedScene, spawn_location = Vector2(0,0), spawn_direction = 1):
#screen_transition.play('FadeToBlack')
if(current_scene.get_child(0)):
if(current_scene.get_child_count() > 0 and current_scene.get_child(0)):
current_scene.get_child(0).queue_free()
current_scene.add_child(new_scene.instantiate())