I’ve been playing with a game for my elementary students and am having director class issues. When I try to change the scene, things work fine until I have my variable set to true. If I set the variable set to true outside of a function or within the director function, things work fine. But I have an onComplete=changeToScene that call the variable true and nothing happens. I put a print for the terminal and the print shows just fine and I don’t see any errors.
The following code works just fine:
function changeScene()
testing = true
if testing == true then
director:changeScene("sceneOne");
print("aAAAAARRRRR")
end
function cleanUp (event)
end
end
but if testing is called to true inside of a different function, only print(“aAAAARRRRR”) works
function changeToScene()
testing = true
end
transition.to(corrTile, {time = 1000, delay = 1500, alpha = 0, y=0, rotation=90, onComplete=changeToScene})
function changeScene()
if testing == true then
director:changeScene("sceneOne");
print("aAAAAARRRRR")
end
function cleanUp (event)
end
end
--the AAAARRRR prints, but no scene change
Does anyone have any ideas? I’m happy to share the whole file if that helps.
Thanks [import]uid: 48122 topic_id: 10529 reply_id: 310529[/import]