Timer before removing scene

When I use the goToScene call, I use the removeScene call right after it. Problem is that it doesn’t let the fade transition effect finish first. Any idea how to avoid this?

You could ad it into the destroy scene. Check this link out ( Its at the bottom )

https://docs.coronalabs.com/daily/api/library/composer/index.html

Good Luck!

Are you saying you’re calling remove scene on the scene you just exited?

If so, you could user timer.performWithDelay and an appropriate wait:

timer.performWithDelay( 1000, -- OR longer function() -- ACTIONS YOU WANT TO WAIT HERE end )

However, you’re better off doing the remove scene in the scene you’re entering and calling it in the ‘did enter’ phase.

Yes i was also thinking of removing previous scene in the new scene but is that actually possible? I never tried so couldn’t suggest.

But yes i have used the timer method before! So should work!

Thanks @RoamingGamer!

scene:destroy() is called as a process of composer:destroy(). The only things you need to put there is like removing audio that you loaded in scene:create().

You should not destroy a scene that you are currently in. It’s always best to either call composer.removeScene() just before you go to it.

Rob

Thank you guys, got it working!

You could ad it into the destroy scene. Check this link out ( Its at the bottom )

https://docs.coronalabs.com/daily/api/library/composer/index.html

Good Luck!

Are you saying you’re calling remove scene on the scene you just exited?

If so, you could user timer.performWithDelay and an appropriate wait:

timer.performWithDelay( 1000, -- OR longer function() -- ACTIONS YOU WANT TO WAIT HERE end )

However, you’re better off doing the remove scene in the scene you’re entering and calling it in the ‘did enter’ phase.

Yes i was also thinking of removing previous scene in the new scene but is that actually possible? I never tried so couldn’t suggest.

But yes i have used the timer method before! So should work!

Thanks @RoamingGamer!

scene:destroy() is called as a process of composer:destroy(). The only things you need to put there is like removing audio that you loaded in scene:create().

You should not destroy a scene that you are currently in. It’s always best to either call composer.removeScene() just before you go to it.

Rob

Thank you guys, got it working!