[Resolved] Quick question about storyboard.reloadScene()

I thought storyboard.reloadScene() will work similar to storyboard.loadScene() and re-execute createScene. I ran a few tests and it does not look like behaving that way. What is this function supposed to do? [import]uid: 19297 topic_id: 26061 reply_id: 326061[/import]

I just ran a quick test and it seemed to work fine. Make sure you are using a build that supports it, is my suggestion.

See here; http://developer.anscamobile.com/reference/index/storyboardreloadscene

Peach :slight_smile: [import]uid: 52491 topic_id: 26061 reply_id: 105567[/import]

I am using 797. Let me confirm if I am doing this right. Since the scene was loaded/transitioned, I changed value of a display object (namely text). Then called a reloadScene and subsequent gotoScene. Should not I see the display object reflect the new value? [import]uid: 19297 topic_id: 26061 reply_id: 105570[/import]

I just testing this in 797 and it actually worked fine - were you trying in the sample or your own project? [import]uid: 52491 topic_id: 26061 reply_id: 105764[/import]

I am using in a project. But for testing, I took the storyboard sample. I added a text to show os.time(os.date( ‘*t’ )), then removed the storyboard.purgeScene(“scene1”) from enterScene of scene2, in scene4 when it is calling gotoScene for scene1, I added a reloadScene right before it. I was expecting to see the text in scene1 reflect the new time, but it did not. [import]uid: 19297 topic_id: 26061 reply_id: 105781[/import]

Are you able to file a bug report with that sample you refer to for someone to run and confirm, please? [import]uid: 52491 topic_id: 26061 reply_id: 105972[/import]

This sounds like your misunderstanding how reloadScene works.

reloadScene does exactly that, it reloads the scene. It’s the equivalent to going to the scene for the first time. If you want it to reflect a changed variable/value between changing/reloading scenes, you probably want to store the value in a file and read it back when reloading/returning to the scene. Or add it to the storyboard table to keep it persistent along scene changes/reloads.

[import]uid: 84637 topic_id: 26061 reply_id: 106091[/import]

Danny: I realized last night that I was calling the function as reloadScene(""). I misread the document that reloadScene() only reloads the current scene. I am making the change today and will report back if that is working.

Thanks to both of you. [import]uid: 19297 topic_id: 26061 reply_id: 106099[/import]