Hi all

I would like to reposition my player when it is hitting an Area2D. Based on how my game works it would be most suitable for me to run "get_tree().reload_current_scene" afterwards. I would like to respawn my player in a specific location when it hit this Area2D.

One thing I tried to make it work is to store two values for x and y for the player according to this tutorial:

Another thing I tried is to store x and y values as Singletons.

Both of these basically work when I call them from a function, but not when I use "get_tree().reload_current_scene" in the same function.

func reload_02():
load_data_02() #that's for position
get_tree().reload_current_scene

Do you have any ideas?

Thanks a lot!

    aksu Why dont you set position in the scene _ready() function ?

    func _ready():
        position = SingleAton.saved_position

    Put a marker in the scene where you want the player to spawn, set the player position = the marker position. Or just put the player in the correct place to begin with (assuming it is part of the scene you're reloading).