timer.performWithDelay() is calling a function in the previous scene that has the same name as a function in the _current _scene.
Repro steps:
Create two scenes, scene A (the default scene) and scene B
Add a lua function that has the same name to both scenes
In scene A , use timer.performWithDelay() in show() to call the function at some interval with infinite iterations. Be sure to remove the timer in hide().
In scene B , use timer.performWithDelay() in show() to call scene B’s version of the function at some interval with infinite iterations.
When scene B tries to call the function, it calls the function in scene Ainstead of calling its own version. It seems like composer hasn’t switched memory contexts yet or something.
Is this a bug (know or not), or the intended behavior of composer?
Composer doesn’t clean up timers for you, so it’s possible that the timer started in scene A is still running, and therefore calling the function at it’s completion. Have you added print statements to determine which _ specific _ function is being called when a timer is completed?
Composer doesn’t clean up timers for you, so it’s possible that the timer started in scene A is still running, and therefore calling the function at it’s completion. Have you added print statements to determine which _ specific _ function is being called when a timer is completed?