Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | christianbegg2 |
how do i do that
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | christianbegg2 |
how do i do that
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
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