How can I load a lot of data on to a scene?

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

When I change scenes in my game then back the scene resets. So a solution I came up with was that you save the scene data in a singleton then you load it back up. But loading 7500000 blocks every time I go back in a scene will take a long time. I do not know if this solution works but the player can only see a certain amount of the world at a time so when the player sees a new region you load the tiles in the view of the player. Does this work or is there a better solution?

:bust_in_silhouette: Reply From: usurun

If you go to project, project settings, and the AutoLoad tab, there you can have a scene that will be always loaded (it loads automatically), and it is apart from your scene (root/yourscene) here you can have a scene that can manage all your information. Hope that helps.

I do not quite understand you. I put my scene on auto load and it saves the data but when I switch back to the scene there is the same scene on top of the other scenes so like 2 players instead of 1. I use get_tree().change_scene('res://scene.tscn') Is there some other scene switching function so there is no duplicate?

jujumumu | 2019-09-09 01:31