So I assume, 2 things:
- either you are loosing a reference to player instance
- or you are deleting player with a scene, because it's connected
The way I would do it, is to store a reference to a player somewhere in a singleton, or add it to the root tree temporarily and then, when a new scene is loaded, add it as a child. But the important thing here is that you need to call remove_child
first like this:
player.get_parent().remove_child(player)
# or if the parent of player is current scene just remove_child(player)
# store player reference
Global.store_player(player)
# after a new scene is loaded
add_child(Global.get_player())