Question with temporary variables and *goto_scene

Hi, I’m just wondering if local variables persist even if you run multiple iterations of a scene. Here’s an example:

I have scenes “scene1” and “scene2.” Inside scene1, I have a local variable called “variable1.”

If I *temp variable1 10, then use *goto_scene scene2, and then return to scene1, will variable1 still be 10? Or will I have to declare it again?

If you use *gosub_scene, and an appropriate *return, then the value should persist. With *goto_scene it will not.

3 Likes