I have implemented smooth scene transitions by creating a hidden “CameraFocus” object that the camera stays centered on. Then I tween that object to the side to slide the scene in (and also to slide out). This works 100% of the time when I preview the scene directly, but if I transition between scenes I see random delays from 5 to infinity seconds before the new screen slides into view. Using the debugger, the new scene starts immediately but the camera is stuck out of the scene… until it decides it is ready to slide-in correctly. Does anyone else do this type of scene transition?
Tween work in background with timers.
It’s recommended to delete the Tween when this one is over.
Can you test without Tween?
You can use the function lerp(startposition,aimposition, time)
This avoid the Timer from Tween and identifiers, this will give us a first indication if the issue is from the Tween or not.
If I remove the tweens, the scene transition is INSTANT and reliable.
If I replace the tweens with lerp, the scene transition is SMOOTH and reliable.
This definitely relates to when tweens start at the beginning of a scene (used for the fade-in). My fade-out tweens always trigger reliably from the button click.
@Bouh, FWIW, in my response to the original post I did a test by deleting the tweens at the start of the scene, and at the end just before the scenes were changed. It had no effect and did not reduce the delay.
For the record, the issue was that tweens were not processed correctly in the case where there was no objects with the Tween behavior activated in the scene, and when one was then first added.