[Solved] Sliding scene transitions have long and variable delays

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?

Video that shows the long and variable delays between scenes.

Project file to demonstrate delay in scene transitions

Original post:

You use the same identifiers in the scenes and you didn’t remove the timers before go to the other scene.

@Bouh - Thanks for looking into this!

I just tried renaming the tween identifiers so each scene has it’s own, but the problem still exists.

I even tried using different names for the “CameraFocus” object, and deleting that object before changing scenes, but the problem still exists.

I’m not sure what you mean regarding timers; I don’t have any timers in this project.

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.

I can confirm that this bug was fixed by this commit: Fix tweens not properly applied when only one object with the Tween b… · 4ian/GDevelop@4760b0a · GitHub

1 Like

Good to know! Thanks for trying the nighty build :slight_smile:

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.