I have a CCScene which I originally used in a call to director runWithScene. Then, I use replaceScene to load a few new scenes. This works fine (from Lua of course).
At some point, I want to go back to my original (first) scene. When I do this, before I actually call replaceScene with it, I want to add some children to it by calling scene:addChild.
At this point, I get error:
invalid 'self' in function 'addChild'
This is the same code I ran for the original and subsequent scenes, it fails when I try to director.replace to any scene that was already used (original or subsequent).
Is it not allowed to reuse a scene? If not, what’s going on?
Replace to scene B from Lua (but keep a reference to scene A
Now try to replace back to scene A from Lua
This didn’t work for me, it looks like the C*+ scene was deleted out from under the Lua reference . So I can keep the Lua reference but I cannot reuse the C*+ underneath, it’s useless.
Can anyone confirm this is the case, or is it a bug?