I want the scene to restart when my kinematicbody2d enters an Area2d.

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

help me? I would like the scene to restart when my kinematicbody2d enters a 2d Area.

:bust_in_silhouette: Reply From: scrubswithnosleeves

Just change the scene to the current scene:

get_tree().change_scene("path_to/current_scene.tscn")

do this on the Area2D’s body_entered signal

:bust_in_silhouette: Reply From: Wrench

just Connect Area 2D Signal, body entered.
in function body Type “get_tree().reload_current_scene()”