Loading sprite when using more then one scene.
Posted: Fri May 31, 2019 11:40 pm
Hello, I have an issue trying to save and load sprites.
I have a scene in which I save the tiles of a tilemap and load them according to the player position, this works, I get the sprite data:
as seen in this gif
https://i.imgur.com/iPRN7z4.gifv
The problom is when I load this scene as part of a different scene (with loadSceneAsync)
all of the tile sprite data are null
Now I can only assume this is happening due the the sprite ref already existing in the first scene for some reason, the question Is how do I load the sprite then as I do not want to save the actual image for each tile but just the correct ref.
I have a scene in which I save the tiles of a tilemap and load them according to the player position, this works, I get the sprite data:
as seen in this gif
https://i.imgur.com/iPRN7z4.gifv
The problom is when I load this scene as part of a different scene (with loadSceneAsync)
all of the tile sprite data are null
Now I can only assume this is happening due the the sprite ref already existing in the first scene for some reason, the question Is how do I load the sprite then as I do not want to save the actual image for each tile but just the correct ref.