when I hit a block can I respawn at a checkpoint?

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

how do i do that

:bust_in_silhouette: Reply From: Lucas Coelho

You need to create a Area2D node which stores player position when the signal “On 2d body enter” is emitted by the player, for example:

_on_2D_body_enter(body):
     if (body.is_in_group('player'):
         var check_position = body.position

(obs.: to do this you need to put the player into the player group)

and then you just need to set the player position towards check_position when needed

:bust_in_silhouette: Reply From: ZBot

You can reset the scene. If there is a score element it can be stored in a text file, have the UI as a seperate instance scene which gets instanced at scene restart.

This way you can just use

reload_current_scene